What is Copyopacity in version 7 of magick.net

534 Views Asked by At

I am using Magick.net to make some changes on user pictures. To Cut out a specific part of the picture I used composite with the compositoperator.Copyopacity it have been working perfectly. Then I upgrade to version 7 and now I have to user other compositoperators I found that the DstIn is something like copyOpacity and is doing my job. But the problem is that when I apply that command the pixels that are in the mask picture (the auxiliary picture which is black with some transparent area, the transparent are the area that I wanted to cut out) and are not 100% black transfers to the final picture so I have a gray and ghostly lines on the final picture. I thought maybe I have to edit the mask picture and remove all the pixels that are not 100 percent black but the problem is that I have to resize the mask in relation to the user uploaded files.

my questions :

How can cut out a part of the user picture and have a picture as my result that has the cut out part and the rest is transparent ? the technology and framework that I am using: .Net Mvc c# and Magick.net version 7

1

There are 1 best solutions below

0
On

After lots of researches I found the solution. In Image Magick 7 you do not have copyopacity composite operator but you have copyAlpha. In this approach you can have an auxilary image that is all black with some white shapes (these white shapes are the parts that you want to cut out from the user image) then you have just to composite user image with this auxiliary image with the CopyAplpha composite operator.