Know a run-time JPEG decoder?


Does anyone know of a decent run-time JPEG decoder that would work out of the box in Unity? On mobile devices. Doesn’t have to be super fast; I’d use it when loading a scene.

What I need essentially is something that would make a byte → Color32 conversion without extra memory allocations, as I need to merge the Color32 array into another array again. I know about


and its sister


but I’d really like to avoid copying the buffer twice. (As I imagine the Texture2D.GetPixels32() only returns copied data.) The image is relatively large.

Surely there must be a library or a bunch of scripts somewhere. Although I can’t find anything…

I’ve just found this decoder on google code. It looks like it’a a whole JPEG framework. It also has an encoder. Haven’t tested it yet if it runs in Unity, but it looks like it’s pure managed code, but i might be wrong.