Page 1 of 1

IM Unsharp vs PS USM

Posted: 2013-12-03T21:13:11-07:00
by bsguy
Hi All

I have a problem replicating a result from PhotoShop. I have a client who runs and image through a 2 step process in PhotoShop.

Step 1: Unsharp Mask Amount 18%, Radius 30 pixels, Threshold 4
Step 2: Unsharp Mask Amount 190%, Radius .5 pixels, Threshold 4

I've tried to replicate the result using the equivalents listed below.

Step 1: Unsharp Mask Amount .18, Radius 30, Threshold 0.0156
Step 2: Unsharp Mask Amount 1.9, Radius .5, Threshold 0.0156

I've experimented trying to vary sigma as a function of radius and vice versa but have not had satisfactory results.

In short, does anyone know the function for sigma to achieve a result similar to PS in my scenario?

Thanks
Danny

Re: IM Unsharp vs PS USM

Posted: 2013-12-03T21:33:40-07:00
by snibgo
IM's "-unsharp" can take both radius and sigma. See http://www.imagemagick.org/script/comma ... hp#unsharp

When setting just sigma the effect can theoretically spread infinitely far, so set radius to limit the effect. As a rule of thumb set radius to 3 times sigma. Do set sigma. This has more effect than radius on its own. If you just set radius I don't know what sigma IM uses.

If you like you could put up some samples. An original image, then 2 of that image at different amounts, another two of different radiuses and a third pair of different thresholds. Vary just one parameter within each pair. Then someone might try to replicate the results in IM. (Not me as I'm about to go to bed.)

You can put the images somewhere like dropbox.com and paste the URLs here.

Re: IM Unsharp vs PS USM

Posted: 2013-12-04T10:37:03-07:00
by GreenKoopa
I don't have Photoshop, but I did recently have this same question using GIMP. See topic:

unsharp parameters: GIMP -> IM
viewtopic.php?f=1&t=23747

I found amount/gain and threshold to work as I expected. My issue was with converting radius & sigma. I found:
GreenKoopa wrote: viewtopic.php?f=1&t=23747#p100643
IM Sigma is GIMP Radius plus not quite one, and IM radius is twice that."
So try using Photoshop's radius as ImageMagick's sigma, possibly +1. Radius is probably best left as 0, allowing IM to calculate a reasonable value. I think GIMP limits it to 2x sigma because GIMP is limited to 8-bit precision.

If you want an exact match, I came up with a simple quantitative test.
GreenKoopa wrote: viewtopic.php?f=1&t=23747#p101287
I created an image that was one edge, with the left half dark and the right half light. I sharpened this test image using GIMP. I then took the middle row and graphed the pixel values. It is easy to see the radius, simply count how far out pixels changed. With the IM radius set, I varied sigma until the graphs matched. It was sigma = GIMP Radius + almost 1, which was half the previously noted radius. I ran tests through the ranges noted above.

Re: IM Unsharp vs PS USM

Posted: 2014-04-27T13:18:32-07:00
by Drazick
I think Photoshop's Unsharp Mask is completely different from IM and GIMP.
Look here:

viewtopic.php?f=22&t=25477