JayXon / Leanify

lightweight lossless file minifier/optimizer
MIT License
831 stars 75 forks source link

How to make jpeg progressive? #47

Closed b1rdex closed 5 years ago

b1rdex commented 5 years ago

I see it in source, but how it works with default settings? Is it applied for all files or not? How do I force it to be always used?

JayXon commented 5 years ago

The default is progressive, but if it does not decrease file size then we keep the original, or if it's a small file and baseline is better than progressive then we use baseline. There isn't an option to force progressive because we always prefer whatever that gives smaller file size.

b1rdex commented 5 years ago

That's sad because progressive is always bigger AFAIK. I'm not too good in c++, can you please help me with patch to force progressive for files bigger that 10KB? I'll try to say why: I'm using Leanify to process images for web site and progressive jpeg is a must for web images.

JayXon commented 5 years ago

Are you sure? I think progressive is usually smaller for large images, and baseline is usually smaller for small images, for websites I think using baseline for small images is totally fine. If progressive is an absolute must for all images, then I would suggest to use mozjpeg and manually specify the options to force progressive.