I'm Jon Olick. I make shiny things. I simplify.

I presented Sparse Voxel Octrees at Siggraph 2008.

Saturday, April 17, 2010

Simple JPEG Encoder/Decoder

Its hard to find simple, single C/C++ file jpeg encoders/decoders with no dependancies on external libraries.

So far thats the best I've found as far as simplicity.

I put this one together based on a javascript encoder. Its not optimized, but its functional and in a single file. Enjoy! :)


  1. For decoding, Sean Barrett's stb_image.c rocks (decodes jpg, png, tga, psd etc.). One C file: http://nothings.org/stb_image.c

    I've seen a simple, one-file jpg encoder ported Unity's JavaScript: http://technology.blurst.com/unity-jpg-encoding-javascript/ (based on some ActionScript encoder). Should be trivial to port to C/C++.

  2. thats a great link! thanks! :)