-
Hi, I'm trying to migrate from ImageMagic to libvips as it should be much faster. However, I have noticed that libvips often (for ~40% of my images) significantly changes (increases or decreases) an image size during auto-rotation when ImageMagic gives a much closer result. I'm trying to understand why it happens and how to apply auto-rotation without loosing quality and gaining size. Here are examples:
Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @palexvs, I think this is because imagemagick tries to "guess" (from an examination of the huffman tables) the Q factor a JPEG was compressed with, and then by default will reencode with this same Q. Using your example1:
So it looks like your original has been encoded with Q90. imagemagick tried to guess this setting and keeps the size about the same (very roughly). libvips uses the standard JPEG default Q factor of 75, unless overriden. I think it's a difference in philosophy. libvips tries to be predictable and not do too much magic behind your back, whereas IM tries to guess what you want. That's great when it guesses right, but can be annoying and unexpected if it fails. |
Beta Was this translation helpful? Give feedback.
Hi @palexvs,
I think this is because imagemagick tries to "guess" (from an examination of the huffman tables) the Q factor a JPEG was compressed with, and then by default will reencode with this same Q.
Using your example1:
So it looks like your original has been encoded with Q90. imagemagick tried to guess this setting and…