Page 1 of 1

Resize: Photoshop vs Imagemagick

Posted: 2008-05-02T07:16:32-07:00
by johnford
Hi All,

Im using the following command to resize an image:

convert c:\start.jpg -filter Blackman -antialias -resize 800x800 -quality 90 c:\im_resize.jpg

When I resize the image with Imagemagick it is blurry but when I resize using Photoshop it looks alot better.

I have zipped up the original image and both the resized images, download here

Im using ImageMagick-6.4.1-Q16.

Im not sure if this is relevant but the original has been editied by Imagemagick already to change the profile.

Please can you let me know what I'm doing wrong?

Many thanks,

John.

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-02T07:29:20-07:00
by magick
Why the Blackman filter? Try without it. Photoshop may automatically include a sharpening step. ImageMagick does not, but you can include it with the filter blur setting. See http://www.imagemagick.org/Usage/resize/ for a discussion of resizing an image.

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-02T07:32:28-07:00
by johnford
Even if I try without the filter option it looks just as bad. The image seems to lose all quality.

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-02T10:54:51-07:00
by fmw42
leave off the -antialias and use the default filter (-filter lanczos) to get the best compromise results. However if you want the least blurring, use -filter point (which removes all antialiasing)

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-06T01:20:20-07:00
by johnford
Thanks for the help, the image does look a lot better now but still not as good as Photoshop.

Is this command correct:

convert c:\start.jpg -set option:filter:blur 0.5 -filter point -resize 800x800 -quality 90 c:\im_resize2.jpg

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-06T02:33:59-07:00
by Bonzo
This is a piece of code I wrote to try different filters:

Code: Select all

<?php
// Build the array of filters to be used
exec("convert -list filter", $IMarray, $code);
// Start the loop to resize with the different filters
foreach ($IMarray as $value) {
$new_name = $value."_resize.jpg";
exec ("convert sunflower.jpg -filter $value -resize 100x100 $new_name");
echo "<tr><td><img src=\"".$new_name."\"width=\"300\" height=\"225\"></td>";
echo "<td>$value</td></tr>;
}
?>
The results of my test: http://www.rubblewebs.co.uk./imagemagic ... filter.php

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-06T22:07:29-07:00
by fmw42
Is this command correct:

convert c:\start.jpg -set option:filter:blur 0.5 -filter point -resize 800x800 -quality 90 c:\im_resize2.jpg

Leave off the -set option:filter:blur 0.5 as that will only blur or sharpen the result more than optimal. I am not too sure whether 0.5 will try to blur or sharpen. The default filter is lanczos which is probably the best you will find in IM and should produce better results than in Photoshop, unless they have upgraded their filters from cubic as the best they had some time ago when I last looked.

Hopefully Anthony will respond and can inform you better about the use of -set option:filter_blur.

try:
convert c:\start.jpg -resize 800x800 -quality 90 c:\im_resize2.jpg

if you use -filter point it may leave aliasing artifacts. You may or may not want to use -filter point depending upon your image. Try without and with and see which looks best.


Are you making your images smaller or bigger by -resize 800x800?

The filters work best for reducing the image size.

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-09T02:57:53-07:00
by johnford
Thank you for the help.

The resize works fine on its own but if I also change the profile it becomes blurry again, Im using:

convert c:\in.jpg -strip -resize 800x800 -profile c:\AdobeRGB1998.icc -profile c:\cmyk.icc -density 300x300 -quality 90 c:\test.jpg

or:

convert c:\in.jpg -strip -filter Point -resize 800x800 -profile c:\AdobeRGB1998.icc -profile c:\cmyk.icc -density 300x300 -quality 90 c:\test.jpg

Im wondering if its an order issue?

Re: Resize: Photoshop vs Imagemagick

Posted: 2008-05-26T21:38:27-07:00
by anthony
Actually -set option:filter:blur is really only useful when using either a gaussian, cubic, or quadratic filter. In other filters it could make things worse!!!!

It is an expert option because you really need some expertise to understand what it is doing. I try to explain what it does in terms of the resize filters, but you need to have a whole understanding of what is going on, to be able to play with such values sensably. It took me years to get my understanding with a lot of false starts.

The point filter, is just a single 'impulse' lookup of colors from the source image. It is equivalent to +antialiasing, and basically turns of all resize filter processing.

Photoshop does do a normal filtered resize of the image, but then follows that by -sharp or -unsharp style sharpening of the image.