Skip to content

Cannot remove clipping mask #789

Answered by dlemstra
hn24 asked this question in Help
Nov 20, 2020 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

You are very close but the difference here is that you are not reading the clipping path when you clone it. Your command would translate to this:

using (var image = new MagickImage("image.jpg"))
{
    // magick identify -quiet -format "%[8BIM:1999,2998:#1]" \
    var clippingPathData = Encoding.ASCII.GetBytes(image.GetClippingPath());

    // ( - <= The '-' means the image is read from stdin
    using (var clippingPath = new MagickImage(clippingPathData))
    {
        // -alpha off
        clippingPath.Alpha(AlphaOption.Off);

        // -negate
        clippingPath.Negate();

        // -morphology erode diamond:1
        clippingPath.Morphology(MorphologyMethod.Erode, Kernel.Diamond, 1);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hn24
Comment options

Answer selected by hn24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #789 on December 01, 2020 19:41.