Image Resize Blurry / Jagged

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
johnford

Image Resize Blurry / Jagged

Post by johnford »

Hi All,

If I run the following command all is well:

in.jpg -profile c:\AdobeRGB1998.icc -profile c:\USWebCoatedSWOP.icc -level 0%,100%,0.8 -density 150 -sharpen 0.5x0.5 -quality 100 out.jpg

but if I run the same command line with a resize the image becomes blurry:

in.jpg -profile c:\AdobeRGB1998.icc -profile c:\USWebCoatedSWOP.icc -level 0%,100%,0.8 -density 150 -resize 886x886 -sharpen 0.5x0.5 -quality 100 out.jpg

I am using version 6.3.5-8 on a PC.

Any help would be appreciated.

John.
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

Also if I export the image as a tiff it works fine, the only problem is exporting as a jpeg.
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

Any ideas?

Im really stuck on this one.

John.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Image Resize Blurry / Jagged

Post by anthony »

Did you enlarge or shrink the image with the resize?
What was its original size?

Enlarging always is a bit more blury as that is the nature of increasing the number of pixels.

If you shrank the image how are you displaying it? If you are enlarging the image to display it then that enlargement will again make it blury, but it is not the fault of the resize.

Basically how are you viewing/using the image?

Finally JPEG is a lossy format. Any form of processing will cause some loss of quality just from the act of saving to JPEG format. JPEG should only be used for the final image and any form of processing should not read from a JPEG copy of the image (unless that is the only source for the image such as JPEG from a digital camera). Avoid JPEG as an intermediate image format.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

Hi,

Thank you for the reply.

I am shrinking the image.

John.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Image Resize Blurry / Jagged

Post by anthony »

Then your display is not doing proper anti-aliased shrinking. Web browsers image reszing are not known for good results, only fast results. IM -resize is designed for good results (better than photoshop from some web page comparisions).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

I have been viewing the images in photoshop.

Regards,

John.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Image Resize Blurry / Jagged

Post by anthony »

Is photoshop displaying the image at a different zoom that 100%?

That could be the cause of you viewed aliasing problems.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

I dont think photoshop is the problem.

here is the original image.

here is the converted tiff.

and here is the converted jpg.

Both of the images are using the same command line they are just different output formats.

Regards,

John.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Image Resize Blurry / Jagged

Post by anthony »

The result jpg was missing, but the tiff looks pretty dam good to me.
Of course I am not a expert and spotting such blurriness.

But other are, See...
http://www.xs4all.nl/~bvdwolf/main/foto ... ample1.htm
with a comparison of the default IM lanczos filter against other programs
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

Hi,

If you right click on the link and select "Save Target As.." it should download ok.

Thank you for looking into my problem.

I agree the tiff does look good, I would love to use a jpeg though.

Regards,

John.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Image Resize Blurry / Jagged

Post by anthony »

JPEG is however inherently lossy, particularly in sudden color changes such as detail. That is it make the results blurry! The lower the quality setting the worse it gets. Even at 100% quality default JPEG is lossy. Only the new JPEG2000 format has the non-lossy compression method, which of course means (like PNG) it is not very small in file size.

It is a trade off. size verses bluriness and 'ringing' effects.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Image Resize Blurry / Jagged

Post by Bonzo »

I was talking to some one on another forum about jpg quality and he tried different filters which helped.

Here are some links to some articles on image quality previously posted by Anthony.
http://www.xs4all.nl/~bvdwolf/main/f...own_sample.htm
http://www.xs4all.nl/~bvdwolf/main/f...e/example1.htm
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Image Resize Blurry / Jagged

Post by anthony »

Bonzo wrote:Here are some links to some articles on image quality previously posted by Anthony.
http://www.xs4all.nl/~bvdwolf/main/f...own_sample.htm
http://www.xs4all.nl/~bvdwolf/main/f...e/example1.htm
Those pages are 404 Not Found
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
johnford

Re: Image Resize Blurry / Jagged

Post by johnford »

Should the JPEG really look that bad?

If you only remove the resize command the image looks great.

and if you only use the resize command the image looks fine ...

but if you use the complete command it looks really bad.

Am I doing something wrong?

John.
Post Reply