Noobie question regarding CopyPixels

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
JayE
Posts: 2
Joined: 2018-04-05T18:08:34-07:00
Authentication code: 1152

Noobie question regarding CopyPixels

Post by JayE » 2018-04-05T18:22:15-07:00

I'm trying to copy a PNG image (with alpha) onto a transparent/blank background PNG image, but the PNG image I am copying to the background is not displayed, probably because the background image is transparent.

How do I get CopyPixels to ignore the background image?
I tried lots of the Channels.xxx options but nothing seems to work the way I want it to.

// Background
bgndImage= new MagickImage(bytes);

// Copy image onto background
imgAdd = new MagickImage(bytes);
bgndImage.CopyPixels(imgAdd, new MagickGeometry(imgAdd.Width, imgAdd.Height), point.X, point.Y, Channels.RGB);

User avatar
dlemstra
Posts: 1480
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Noobie question regarding CopyPixels

Post by dlemstra » 2018-04-08T12:43:04-07:00

I wonder why you are using the CopyPixels method. I suspect you will need to use one of the Composite overloads to accomplish your goal.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

JayE
Posts: 2
Joined: 2018-04-05T18:08:34-07:00
Authentication code: 1152

Re: Noobie question regarding CopyPixels

Post by JayE » 2018-04-10T18:03:30-07:00

Composite overloads?
How do I use those?

Post Reply