This is really a two-part question, since I do not quite understand how it all works:
My situation: I am writing a web application that allows the user to upload an image. My application then resizes to something displayed (ex: 640x480-ish) and saves the file for later use.
My questions:
- Given an arbitrary JPEG file, is it possible to specify a quality level so that I can use the same quality when saving a modified image?
- Does it even matter? Should I keep all the images at a decent level (for example, 75-80), regardless of the original quality?
I'm not so sure about this because, as I understand it: (let's take an extreme example), if someone had a 5 megapixel image saved at quality 0, it would be blocky. By reducing the image size to 640x480, the blocking will be smoothed out and barely noticeable ... until I save it with a quality of 0 again ...
At the other end of the spectrum, if there were an 800x600 image with q = 0, resizing to 640x480 would not change the fact that it looks like complete crap, so saving with q = 80 would be redundant.
Am I even close?
I use the GD2 library in PHP if this is useful
image-processing jpeg image-compression
nickf Jan 08 '10 at 1:50 2010-01-08 01:50
source share