Composite w/ CopyAlpha #1414
Replies: 2 comments
-
It looks like it's the Clipboards fault? I threw in a |
Beta Was this translation helpful? Give feedback.
0 replies
-
What happens when you use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, thanks for taking the time to look. I am striking out on masking an image using the Composite / CopyAlpha operator.
I essentially have the same problem as this ancient issue: #20
I've confirmed that the mask looks like it should - e.g. a black background with white pixels where I want pixels to be copied. I also confirmed that the mask's
HasAlpha
is set to false, as per the resolution for issue 20.The output, however, is the entire input image. Doesn't matter what I do it's the entire input image!
I've tried using separate input images, including different formats (png and jpeg), and it simply does nothing.
Here's the code - I am using imagemagick.net q16-anyCPU v13.1.3. Note my use case is polygons but I've just gone with the circle here as it's what was asked in the referenced issue above, and is simpler code.
So to reiterate when I set
mg.Write(ms, MagickFormat.Png);
tomask.Write(ms, MagickFormat.Png);
the result looks good:But when I change it back to mg.Write, the pasted image looks identical to the input image - no masking at all.
Does anyone have any idea what I'm doing wrong?
I've also tried mg.Write with MagickFormat.Jpg just in case. Also, the mg.VirtualPixelMethod is commented out but I have tried it with and without and there is no difference in output. I've also tried pasting into multiple apps (Paint, Photoshop) with same result.
Beta Was this translation helpful? Give feedback.
All reactions