mozjpeg
mozjpeg copied to clipboard
cjpeg -restart X corrupts image
Using -restart 1 leaves me with image having large horiz bands of colors and greyscale. Using -restart 100 the result has colors strongly blurred. Compiled on Ubuntu 14.04. Tested also with mozjpeg built on Jan 2015, same results.
Adding -sample 1x1 appears to solve the issue, but the doc does not mention it AFAIK.
I'm curious, what do you use the markers for?
I wouldn't be surprised if it was a forgotten feature that's got broken.
I was astonished how effective mozjpeg's compression is so I was considering to use it on our family photo archive as digital cameras make giant files and there's a little need to archive all those bytes. So I was going through the docs, testing and researching the options to come up with the best settings for mass conversion. Restart markers reminded me of similar nifty self-healing features in other formats/protocols. As I saw quite a few image corruptions in the past going from some position to the bottom, I just wanted to try the option to see what's the byte cost. :-) I understand it might be seldom used these days.
I see. Archival sounds like a good use case for it.
@tuttle Do you see this bug in libjpeg-turbo? I'm wondering if this is specific to mozjpeg.
sorry, no idea
@pornel Do you want to look into this or should we close it? If we don't even know if this is specific to mozjpeg then I think we should just close it.
I've checked and it's mozjpeg-specific bug. Happens only in mozjpeg and only when optimization of progressive scans is enabled.
-restart
works in conjunction with -fastcrush
In this case we could say restart markers and scan optimizations are mutually exclusive options and ignore one when the other is enabled.
Personally it'd prefer a fatal user error instead of silent ignore. It would save some time and/or confusion of the ppl like me who experiment. Thanks. Just my $.02