I need to resize a bunch of large images and make them smaller. The originals are about 2500x3800 and I need to resize them down to about 400x650(I am keeping the exact aspect ratio, these are just some rough example numbers).
I am currently doing it with PHP, imagecopyresampled()
, imagejpeg()
and imagepng()
. When I resize them down this way the client is not happy with the resulting image quality - they're slightly blurry. I am using the highest quality option for both imagejpeg()
and imagepng()
(ie. 100 and 0 respectively).
So how can I resize these images down and get a better quality than what the above is producing? Is there a better option in PHP? Should I use a different tool/language?
One SO question suggested to resize multiple times(eg. first resize to a medium size and then resize that to the small version). Is there any merit to that approach?
The funny thing is, I'm displaying the same resized images at an even smaller size on a different webpage. I'm making them about 10-20% smaller with HTML/CSS. When I do this the client is happy with the quality. So it appears there's a way to increase image quality if you slightly reduce the image dimensions in the browser on the fly with HTML/CSS. Should I use this approach? It doesn't sound like a great idea.