Image Mask combine

Discussions about image processing and document imaging.
Post Reply
fnaudeau
Posts: 14
Joined: Thu Dec 25, 2014 7:25 pm

Image Mask combine

Post by fnaudeau » Thu Aug 18, 2016 11:07 pm

Hello,

I'm migrating from LeadTools to GDPicture, and I'm looking for an equivalent of FeatherAlphaBlendCommand :

Combines image data from two images with feathering. The two images can be combined with variable opacity applied by specifying the region of a fade mask image.

It's useful to merge an image to another based on a masked region.
Is there an equivalent with GDPicture ?


Thanks.
Frédéric

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Image Mask combine

Post by Loïc » Tue Aug 30, 2016 10:45 am

Hello Frédéric.

To better understand you request we would need that you share input images used and produced image. Please send such material through our helpkdesk so we will be able to log the request. See: https://www.gdpicture.com/support/getting-support-from-our-team

With best regards,

Loïc

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Image Mask combine

Post by Loïc » Sat Sep 17, 2016 6:44 pm

Here an example:

Code: Select all

using (GdPictureImaging gdPictureImaging = new GdPictureImaging())
            {
                int imageMask = gdPictureImaging.CreateGdPictureImageFromFile("e:\\mask_test\\Anniversaire1_mask0.png");
                int imageBackground = gdPictureImaging.CreateGdPictureImageFromFile("e:\\mask_test\\Anniversaire1.jpg");
                int imageLayer = gdPictureImaging.CreateGdPictureImageFromFile("e:\\mask_test\\layer.jpg");
                gdPictureImaging.DrawGdPictureImageOP(imageLayer, imageMask, 0, 0, gdPictureImaging.GetWidth(imageMask), gdPictureImaging.GetHeight(imageMask), Operators.OperatorAnd, System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic);

                gdPictureImaging.SetTransparencyColor(imageMask, Color.Black);
                gdPictureImaging.DrawGdPictureImage(imageMask, imageBackground, 0, 0, gdPictureImaging.GetWidth(imageBackground), gdPictureImaging.GetHeight(imageBackground), System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor);
                gdPictureImaging.ReleaseGdPictureImage(imageMask);
                gdPictureImaging.ReleaseGdPictureImage(imageLayer);
                gdPictureImaging.SaveAsJPEG(imageBackground, "e:\\mask_test\\result.jpg", 90);
                gdPictureImaging.ReleaseGdPictureImage(imageBackground);
            }

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests