How to repeat exact Photoshop actions in Magick .net to apply a mask with proper feathering on edges? #7031
Replies: 6 comments 5 replies
-
Post your input images |
Beta Was this translation helpful? Give feedback.
-
We need your separate input image, mask image and corresponding separate output from Photoshop. |
Beta Was this translation helpful? Give feedback.
-
I have Photoshop, but am not an expert and do not know how you achieved the steps you show. Please list step by step the menu/menu item that you used to achieve your results. I do not know how you got to your image I suspect the issue is how Photoshop does it feathering. It may be different from how Imagemagick can do that. In Imagemagick command line, you can do a basic feather and the rest of your processing as Unix syntax:
|
Beta Was this translation helpful? Give feedback.
-
@futureimage: your "feather radius" is just 1 pixel. With such a small amount, it is difficult to see exactly what is happening, and difficult to replicate the effect. You might try a larger effect, eg a radius of 10 pixels. |
Beta Was this translation helpful? Give feedback.
-
This is what I get in Photoshop when using your recipe above. And this is what I get in Imagemagick with the following command
Is this close enough? |
Beta Was this translation helpful? Give feedback.
-
The solution given by fmw42 introduces a darkening at the feathering. This is particularly obvious at top-right. Windows BAT script:
The darkening is because the colours (the light cloth and the red bacground) are mixed at the feathering in sRGB space. A remedy is to convert both colours to RGB, then mix, then convert the result back to sRGB. "red" has the same pixel values in sRGB and RGB, so we don't need to convert that.
|
Beta Was this translation helpful? Give feedback.
-
I have two images: one color image (original) and one grayscale image created by AI with only black and white colors to work as mask. I have combined these as one layered image:
I am applying the white area as mask to make the background transparent. In photoshop:
Select -> Color range (White), Fuzziness 100
Select -> Modify -> feather 1px
Layer -> Layer Mask -> Reveal Selection
The image transparency looks good with soft edges (red bg added for better visual evaluation).
I am able to create the masked PNG file with Magick .Net, but the edges are not as good as they are with photoshop. This is my latest code:
How can I repeat the Photoshop steps EXACTLY the same in Magick .Net?
Input images as zip:
files.zip
Beta Was this translation helpful? Give feedback.
All reactions