Page 1 of 1
lossless jpeg compression
Posted: 2016-12-19T05:53:16-07:00
by lasandcris
Hi,
There might be a simple answer to this but looking through the docs and the forum I could find an answer. What is equal to setting the flag to lossless jpeg output? Does this mean 100% quality and no sub-sampling? Or is there something more to it?
thanks,
laszlo
Re: lossless jpeg compression
Posted: 2016-12-19T08:10:05-07:00
by glennrp
There is more to it. You must install a JPEG library that is capable of lossless compression/decompression, then use "-quality 100" to use it. See
https://en.wikipedia.org/wiki/Lossless_JPEG. The WEBP, JPEG-LS, and JPEG-2000 libraries support lossless JPEG. But if you need lossless compression you're probably better off using a lossless format such as PNG, TIFF, PPM, or some RAW format.
Re: lossless jpeg compression
Posted: 2016-12-19T09:07:30-07:00
by lasandcris
@glennrp - thanks for your reply. just to put it into perspective, I've built libjpeg and want to get the same result as ImageMagick lossless jpeg compression. libjpeg gives examples on how to compress to jpeg including the one I mentioned - 100% quality and no sub-sampling - which seems to be their highest quality settings. But I wonder if this is the same as ImageMagick's lossless compression.
Re: lossless jpeg compression
Posted: 2016-12-19T11:47:47-07:00
by glennrp
Regular JPEG with quality 100 is "almost lossless". You probably cannot see the difference but you can measure it.