Problem with Jpeg Quality
-
- Posts: 4
- Joined: 2014-08-19T07:04:21-07:00
- Authentication code: 6789
Problem with Jpeg Quality
Hi,
I'm experimenting with ImageMagick for re-sizing and compressing JPGs on my webserver. Getting the best file-size/quality is really important for this project.
My test image seems to be poor quality when saved from ImageMagick compared to other programs, for the same file size.
I've put some example files here:
https://www.dropbox.com/sh/87gxp9f1r517 ... G2zeUk2T4a
I re-sized and compressed the large Original.jpg with ImageMagick 6.8.9-6 Q16 Windows with the command:
convert Original.jpg -resize 640x640 -quality 35 ImageMagick.jpg
and got a file that's about 39k.
I did the same with PaintShopPro 5 - using a quality of 20 to get the same filesize.
As you can see there's a lot more banding in the sky in the ImageMagick version - and a lot more jpeg artefacts round the building.
The ImageMagick re-size seems good - I think the problem is with the jpeg compression.
As there are so many settings, I was wondering if there's something else I should try to get a better result.
Thanks for any help
I'm experimenting with ImageMagick for re-sizing and compressing JPGs on my webserver. Getting the best file-size/quality is really important for this project.
My test image seems to be poor quality when saved from ImageMagick compared to other programs, for the same file size.
I've put some example files here:
https://www.dropbox.com/sh/87gxp9f1r517 ... G2zeUk2T4a
I re-sized and compressed the large Original.jpg with ImageMagick 6.8.9-6 Q16 Windows with the command:
convert Original.jpg -resize 640x640 -quality 35 ImageMagick.jpg
and got a file that's about 39k.
I did the same with PaintShopPro 5 - using a quality of 20 to get the same filesize.
As you can see there's a lot more banding in the sky in the ImageMagick version - and a lot more jpeg artefacts round the building.
The ImageMagick re-size seems good - I think the problem is with the jpeg compression.
As there are so many settings, I was wondering if there's something else I should try to get a better result.
Thanks for any help
Re: Problem with Jpeg Quality
I would try this and see what you get:
Code: Select all
convert Original.jpg -thumbnail 640x640 -quality 100 ImageMagick.jpg
-
- Posts: 4
- Joined: 2014-08-19T07:04:21-07:00
- Authentication code: 6789
Re: Problem with Jpeg Quality
Yes - that looks better - but it's 239k! I'm trying to get better quality at the same file size.
Re: Problem with Jpeg Quality
Out of interest what file size do you have if you use -quality 70 now?
-
- Posts: 4
- Joined: 2014-08-19T07:04:21-07:00
- Authentication code: 6789
Re: Problem with Jpeg Quality
-70 gives a filesize of 52k. Quality is not far behind the PSP version - but obviously that's a big difference in filesize if you're preparing images for the web. (I guess for a lot of other purposes it doesn't really matter that much).
Just wondered if it was something I'm doing wrong...
Just wondered if it was something I'm doing wrong...
Re: Problem with Jpeg Quality
Re: Problem with Jpeg Quality
Be sure you haven't got a large amount of metadata in the file. That is usually the cause of surprisingly large JPEG outputs. Your Original.jpeg has at least
Profiles:
Profile-exif: 13820 bytes
Profile-xmp: 3965 bytes
Profiles:
Profile-exif: 13820 bytes
Profile-xmp: 3965 bytes
-
- Posts: 4
- Joined: 2014-08-19T07:04:21-07:00
- Authentication code: 6789
Re: Problem with Jpeg Quality
Yeah - that was it: adding a -strip to my command line has got rid of the extra file size.
Thanks very much glennrp.
Thanks very much glennrp.
Re: Problem with Jpeg Quality
You have also lost your colour profile now.
Re: Problem with Jpeg Quality
But "Original.jpg" doesn't have a colour profile. All it has is a "Colorspace 1" entry inside the EXIF data, which means sRGB. Currently ImageMagick is assuming sRGB anyhow. Note that with the current IM6, "convert Original.jpg Original.png" inserts the sRGB chunk, gAMA 1/2.2, and the cHRM chunk containing sRGB chromaticities into the PNG file. These chunks also appear in the PNG file if you strip the JPEG first: "convert Original.jpg -strip Stripped.jpg; convert Stripped.jpg Stripped.png"Bonzo wrote:You have also lost your colour profile now.