Bob Meetin on wrote...
| This is a curious problem. I've got a slideshow (PHP) which uses (12)
| 180x135 px images. I use a form to upload the images then convert to
| both resize and lower the quality to make the images lighter. 180x135
| images should not be all that heavy. The goal is 10kb, but let's say
| that 10-15kb is acceptable per image. These are the commands I run as
| well as the output (the original file is img056.jpg and 360x270 px in size):
|
| history | grep convert | grep percent | awk {'print $4,$5,$6,$7,$8.$9 $10}'
|
| convert inv056.jpg -quality 10 -resize180inv056-10percent.jpg
| convert inv056.jpg -quality 20 -resize180inv056-20percent.jpg
| convert inv056.jpg -quality 30 -resize180inv056-30percent.jpg
| convert inv056.jpg -quality 40 -resize180inv056-40percent.jpg
| convert inv056.jpg -quality 50 -resize180inv056-50percent.jpg
| convert inv056.jpg -quality 60 -resize180inv056-60percent.jpg
| convert inv056.jpg -quality 70 -resize180inv056-70percent.jpg
| convert inv056.jpg -quality 80 -resize180inv056-80percent.jpg
| convert inv056.jpg -quality 90 -resize180inv056-90percent.jpg
|
| convert inv056.jpg -quality 100 inv056-100percent-noresize.jpg
| convert inv056.jpg -quality 70 inv056-70percent-noresize.jpg
| convert inv056.jpg -quality 40 inv056-40percent-noresize.jpg
|
| Below is size and output image including the original 360x270px image,
| inv056.jpg:
|
| $ ls -l | grep inv056 | awk '{print $5, $9}'
|
| 136352 inv056.jpg ---->>>> ORIGINAL IMAGE
|
| 34415 inv056-40percent-noresize.jpg
| 41184 inv056-70percent-noresize.jpg
| 158123 inv056-100percent-noresize.jpg (no resizing)
|
| 25605 inv056-10percent.jpg (all resized to 180px wide)
| 26304 inv056-20percent.jpg
| 26862 inv056-30percent.jpg
| 27370 inv056-40percent.jpg
| 27874 inv056-50percent.jpg
| 28442 inv056-60percent.jpg
| 29247 inv056-70percent.jpg
| 30558 inv056-80percent.jpg
| 33625 inv056-90percent.jpg
| 41184 inv056-100percent.jpg
|
|
-------------------------------------------------------------------------------
|
| And the problem - I would expect quality 70% or so to have significant
| effect on the resulting image size, but it's not giving me what I want.
| I can get away with 50% but the decrease is so incremental that it's not
| worth it.
|
| Any thoughts or suggestions?
|
Look like it is working perfectly too me.
While people often us a 'percentage' with a JPEG quality, it isn't
really a percetange. Basically it is just a compression factor into the
lossy JPEG compression algorithm. The final size will be smaller with a
smaller quality.
The actual file size will remain dependant on the actual image size and
content of the image. In fact a slight blur of the image can increase
overall compression quite a lot!
It is a control factor, but the only way to determine the result of that
control for any particular image is by trying it.
In a simular way the PNG quality setting is 2 seperate digits. The
first digit is the 'compression' factor, while the second is a
compression filter for this image type. That first digit will act in a
very simular way to JPEG quality, but definiting 'how much work' the
compresser should do to try and compress this image.
PNG however is a loss-less compression and will always restore the image
exactly, JPEG will NOT the lower the JPEG quality the worse the image
will look!
For more information see IM Examples, Common Image File Formats.
Anthony Thyssen ( System Programmer ) <[EMAIL PROTECTED]>
-----------------------------------------------------------------------------
Dragons have various degrees of flame at their disposal, ranging from
``toast a marshmallow'' to ``make a hole in a rock''. You might want to
keep that in mind next time you consider arguing with a dragon.
-- Robert Asprin, "M.Y.T.H. Inc. Link"
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users