22 ms·
If you ever wanted to write your own JPEG decoder for fun, I recommend Cristi Cuturicu's notes. I wrote my decoder using nothing more than this, and it was a to
by Jasper_ 5y ago
If you ever wanted to write your own JPEG decoder for fun, I recommend Cristi Cuturicu's notes. I wrote my decoder using nothing more than this, and it was a ton of fun. http://www.opennet.ru/docs/formats/jpeg.txt http://www.opennet.ru/docs/formats/jpeg.txt
- tyingq 5y agoI found this pure python implementation very easy to follow: https://github.com/ghallak/jpeg-python/blob/master/decoder.py https://github.com/ghallak/jpeg-python/blob/master/decoder.p... Some of the helper functions in this separate file: https://github.com/ghallak/jpeg-python/blob/master/utils.py https://github.com/ghallak/jpeg-python/blob/master/utils.py
- userbinator 5y agoI wrote one using the official spec --- it has some very useful flowcharts --- but I do recommend writing a JPEG decoder as a short but possibly open-ended exercise, because the results are very perceptible and fun. GIF isn't hard either, and once you've done those, you can move on to video codecs.