Resize: Photoshop vs Imagemagick

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?".
Post Reply
johnford

Resize: Photoshop vs Imagemagick

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Resize: Photoshop vs Imagemagick

Post 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.
johnford

Re: Resize: Photoshop vs Imagemagick

Post by johnford »

Even if I try without the filter option it looks just as bad. The image seems to lose all quality.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resize: Photoshop vs Imagemagick

Post 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)
johnford

Re: Resize: Photoshop vs Imagemagick

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Resize: Photoshop vs Imagemagick

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resize: Photoshop vs Imagemagick

Post 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.
johnford

Re: Resize: Photoshop vs Imagemagick

Post 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?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Resize: Photoshop vs Imagemagick

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply