siiptuo / pio

Optimize images while maintaining the same perceived quality
138 stars 10 forks source link

High local error #14

Open joppuyo opened 3 years ago

joppuyo commented 3 years ago

Because DSSIM uses an average error when calculating dissimilarity, images with large flat colored areas are compressed too much. It would be useful to use approach like Butteraugli which calculates the worst error instead of average error. This could be done for example by calculating the 75th percentile error with DSSIM.

Example image 1

test01

Pio selects image quality 88. So far so good.

test01-out

Example image 2

test02

Pio selects quality 49. Image turns into blurry mess :(

test02-out

Automatic --min calculation does remedy this somewhat but it's a bit of a band-aid fix

siiptuo commented 3 years ago

Test pssim branch. Here's example image 2 optimized with new algorithm and cropped:

image

Not perfect but better than before. For comparison here's the image first cropped and then optimized:

image