It might seem a crazy idea to implement a jpeg encoder in JavaScript and in fact, it is! I did it because of another little project of mine, which is about a way to support alpha-transparency in jpeg images (using basically two images: a normal jpeg and a greyscale mask). I wanted to code a tool to create these images with Appcelerator Titanium, but I had a problem: You can create a jpeg with the getImageData canvas method, but currently the quality option is not working. This was very annoying, because the tool was all about optimized the file size. So the tool was useless without proper jpeg encoding. I searched for jpeg encoders for Python, Ruby or PHP, but there weren’t any! They all rely on external platform specific libraries. Then I remembered that there was an ActionScript 3 based jpeg encoder floating around and I decided to try to port it to JavaScript.
Related Submissions:
- JavaScript Monkey Patching Wikipedia defines Monkey patching as “a way to extend or modify the runtime code of dynamic languages e.g. Smalltalk, JavaScript, Objective-C, Ruby, Perl, Python, Groovy,...
- Better JavaScript Minification Although both CSS and JavaScript may be included within an HTML page, best practices encourage storing CSS and JavaScript in external files that can be...
- JavaScript Dependency Management and Concatenation: Sprockets Sprockets is a Ruby library that preprocesses and concatenates JavaScript source files. It takes any number of source files and preprocesses them line-by-line in order...
- ASP - A Misinterpreted Technology This article tries to introduce the programmers to rediscover Active Server Pages explaining how to use javascript(yeah, I’ve tested mootools in the server side), python,...
- MooTools Lightbox: mediaboxAdvanced Based on Slimbox and the Mootools javascript library, mediaboxAdvanced can handle your images, videos, animations, social video sites, inline elements, and external pages with ease....