I am trying to get similar output in terms of quality that i get in photoshop with imagemagick while resizing an image.
Original : https://upload.wikimedia.org/wikipedia/ ... u_edit.jpg
Photoshop settings
Target size: 1170x882
Here is what i have tried thus far
convert mural_orig.jpg -filter Catrom -resize 1170x882 mural_resize_khavish_catrom.png
convert mural_orig.jpg -resize 1170x882 mural_resize_khavish.png
convert mural_orig.jpg -unsharp 0.25x0.25+8+0.065 -resize 1170x882 mural_resize_khavish_unsharp.png
I think the photoshop generated resize image is better as it sharper than the others.
My aim here is better image quality that has best fidelity to the original.The filesize is not important
Resized images:
https://drive.google.com/file/d/0B_s7n4 ... sp=sharing
Mimic Photoshop Bicubic Automatic Resampling
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Mimic Photoshop Bicubic Automatic Resampling
For downsizing with sharpening, I recommend the technique shown in Resampling with halo minimization. For example, this seems very close to your Photoshop example (both over-sharpened, in my view). I have renamed your input as "MuralPav.jpg".
Code: Select all
call %PICTBAT%resampHM MuralPav.jpg 1170x882 d 200 . . out.png
snibgo's IM pages: im.snibgo.com
Re: Mimic Photoshop Bicubic Automatic Resampling
I have never used a custom script with IM thus far so forgive my ignorance.I run IM on a Unix environment and not windows.Do you have a unix version of the script.If possible could you upload the downsampled image from your script so that I can also visually compare.
Thanks a ton for the help
Thanks a ton for the help
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Mimic Photoshop Bicubic Automatic Resampling
Photoshop adds some unshapening but after the resize. So try
See http://www.imagemagick.org/script/comma ... hp#unsharp
Set radius to 0 --- that lest IM determine the best radius for the given sigma
Set sigma to around 0.5 to 1.5
Set gain to around 0.5 to 1.5
Set threshold to a small number such as 0.05
Code: Select all
convert mural_orig.jpg -filter Catrom -resize 1170x882 -unsharp 0x1+1+0.05 out.png
Set radius to 0 --- that lest IM determine the best radius for the given sigma
Set sigma to around 0.5 to 1.5
Set gain to around 0.5 to 1.5
Set threshold to a small number such as 0.05
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Mimic Photoshop Bicubic Automatic Resampling
I've uploaded the result to:
http://snibgo.com/imforums/MuralPavOut.png
Here's the image, but mangled by bbs forum software:
I wrote the BAT script, but adapted it from the bash script referenced at the top of my page.
http://snibgo.com/imforums/MuralPavOut.png
Here's the image, but mangled by bbs forum software:
I wrote the BAT script, but adapted it from the bash script referenced at the top of my page.
snibgo's IM pages: im.snibgo.com
Re: Mimic Photoshop Bicubic Automatic Resampling
So far snibgo looks better and Fred's command and my attempts above make the image too sharp when compared to the original.
Re: Mimic Photoshop Bicubic Automatic Resampling
This is surely outdated, but I want to point out my writeup about Photoshop's algorithms from 2011.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Mimic Photoshop Bicubic Automatic Resampling
Interesting. Thanks for that.
IM may have changed in this area since 6 years ago, but it provides some insight.
IM may have changed in this area since 6 years ago, but it provides some insight.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Mimic Photoshop Bicubic Automatic Resampling
Catrom is the same as Keys cubic convolution. But is only one of the bicubic family. It produces a very sharp image, but has other artifacts. As both Jason S and snibgo have pointed out. You can tailor your bicubic filter in ImageMagick.
See
http://www.imagemagick.org/Usage/filter/#cubic_bc
http://www.imagemagick.org/Usage/filter/nicolas/
If one of those that looks good to you in terms of artifacts do not produce enough sharpening, then add some small amount of -unsharp.
I think only Photoshop knows exactly how they are tailoring the bicubic and unsharpening. Experimentation as snibgo or Jason S have done is the the only way to get something close.
See also
http://www.imagemagick.org/Usage/filter/#photoshop
See
http://www.imagemagick.org/Usage/filter/#cubic_bc
http://www.imagemagick.org/Usage/filter/nicolas/
If one of those that looks good to you in terms of artifacts do not produce enough sharpening, then add some small amount of -unsharp.
I think only Photoshop knows exactly how they are tailoring the bicubic and unsharpening. Experimentation as snibgo or Jason S have done is the the only way to get something close.
See also
http://www.imagemagick.org/Usage/filter/#photoshop