Are all JPEG compression implementations the same?
At work I recently got a bunch of images and their instructions for compressing them were basically to just open them in photoshop and save them as JPEGs. I figured I could automate this process but right now I'm running into issues because photoshop's ExtendScript is poorly documented (ChatGPT doesn't even know it). Id like to use something else but I have to know first, can I expect to get similar results from other implementations or is there something special about how photoshop exports JPEGs that makes it neccessary?
5 comments
[ 4.2 ms ] story [ 16.2 ms ] threadThere are lots of ways of producing JPEGs with similar visual characteristics but fairly different byte sizes. For example MozJPEG is known to quite efficient, and a tool such as jpegtran can reduce size without changing even a single pixel.
https://www.earth.org.uk/script/lossless_JPEG_compress.sh
See https://github.com/mozilla/mozjpeg
Also, there is a fairly big problem with JPG that the ‘quality’ setting is not calibrated. That is you might look at one image and think it looks fine (which is subjective, depends on what you want to use the image for…) with a quality of 60%, but then you compress a million images at that rate, delete the originals, then you find that many of them look really awful. Not only that but there are images you could have compressed more and still been happy with the output.
If you are publishing images for the web consider using WebP which is consistently better, well supported now, and has a calibrated quality knob.
And thanks for sharing the link to mozjpeg. It's helping me to understand the differences between different jpeg encoders which is very important.