Hi guys,
i'm looking for the equivalent of the -channel RGBA command line option.
The reason is that i like to blur a image with transparency information. I get the same result as described here with the yellow circle with the black creeping pixels at the outline.
So how i can apply the -channel RGBA with MagickWand to fix that?
Thanks!
MagickWand equivalent of -channel RGBA
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: MagickWand equivalent of -channel RGBA
I think that the MagickWand equivalent is:
Pete
Code: Select all
MagickSetOption(magick_wand,"channel","RGBA")
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: MagickWand equivalent of -channel RGBA
Thanks Pete for your reply.
I call this right before MagickBlurImage() but it doesn't work as my test image still has the creeping black pixels.
I call this right before MagickBlurImage() but it doesn't work as my test image still has the creeping black pixels.
Re: MagickWand equivalent of -channel RGBA
I tried to find a workaround but always get stuck. Maybe some of you can help me out with this?!
(I use c# + P/Invoke and my test image is a yellow square on a transparent background)
1.
with the result, that the blur is correct (because of the white color of the transparent pixels i guess) but the background is white (alpha=1/255). But i like to have a full transparent background. How can i achieve this?
2.
with this result. This is what i want. Nice blur with transparent background. The problem here is that MagickSetImageBackgroundColor() does not have any influences. So how i can change the color here? (at another point i use MagickSetImageBackgroundColor() in combination with MagickShadowImage() which works fantastic)
Thanks for any advice!
Cheers,
Florian
(I use c# + P/Invoke and my test image is a yellow square on a transparent background)
1.
Code: Select all
IntPtr newWand = MagickMergeImageLayers(image, ImageLayerMethod.FlattenLayer);
MagickBlurImage(newWand, 0.0, 8.0);
2.
Code: Select all
MagickSetImageBackgroundColor(image, color);
MagickBlurImageChannel(image, ChannelType.AllChannels, 0, 8);
Thanks for any advice!
Cheers,
Florian
Re: MagickWand equivalent of -channel RGBA
Got it!
Code: Select all
MagickNewImage(coloredBG, width, height, color);
MagickBlurImageChannel(image, ChannelType.AllChannels, 0, 8);
MagickCompositeImage(coloredBG, image, CompositeOperator.CopyOpacityCompositeOp, 0, 0);
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: MagickWand equivalent of -channel RGBA
Don't know if this will work but try:
instead of MagickSetImageBackgroundColor.
Pete
P.S. I see you've just got a solution. Try this anyway
Code: Select all
MagickSetBackgroundColor(image, color);
Pete
P.S. I see you've just got a solution. Try this anyway
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: MagickWand equivalent of -channel RGBA
No, that doesn't work either.
Thanks for your suggestions
Thanks for your suggestions