How does -unsharp work?

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

Re: How does -unsharp work?

Post by fmw42 »

Drazick wrote:I think the documentation isn't updated since I clearly see that GIMP is close to Photoshop.

I promise you Photoshop does what I wrote above.

I just don't know why.

That may be true, but you still need to know how to interpret PS radius into IM.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How does -unsharp work?

Post by fmw42 »

Here is a unix IM command line to do what you suggest and comparisons with PS at rad 3(rad=sigma) and 7 (rad=2*sigma+1 as suggested by GIMP). Results are closer but still not a perfect match.

Code: Select all

thresh=9.8
sigma=3
convert lena3.png \
\( -clone 0 -gaussian-blur 0x$sigma \) \
\( -clone 0 -clone 1 +swap -compose minus -composite \) \
\( -clone 1 -negate \) \
\( -clone 0 -clone 3 +swap -compose plus -composite -negate \) \
-delete 1,3 \
\( -clone 1 -clone 2 -compose plus -composite \) \
-delete 1,2 \
\( -clone 1 -threshold $thresh% -negate \) \
-compose plus -composite lena3_im_us_script2_3gx9p8x1.png
Image


PS r=3, amount=100, thresh=25
Image


PS r=7, amount=100, thresh=25
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How does -unsharp work?

Post by fmw42 »

Please do not double post to two different forums in the future. It breaks up the discussion.
Post Reply