UnsupportedPixelFormat status while using RemoveHolePunch method

Discussions about image processing and document imaging.
Post Reply
Anton
Posts: 1
Joined: Tue Sep 26, 2017 8:13 pm

UnsupportedPixelFormat status while using RemoveHolePunch method

Post by Anton » Tue Sep 26, 2017 8:25 pm

Hi,
I'm trying to use RemoveHolePunch on a colored 24 bit jpeg image but constantly gets UnsupportedPixelFormat return status. I tried to use this method on 1 bit image and worked fine.
In the documentation it is said that RemoveHolePunch can be used with 1, 8 and 24 bit per pixel image (see https://www.gdpicture.com/guides/gdpicture/web ... nt32).html).

Is it possible to use this method with colored image or may be I'm doing something wrong?

My C# code

Code: Select all

	    GdPictureImaging image = new GdPictureImaging();
            int imageId = image.CreateGdPictureImageFromFile(inputImage);
            if (imageId > 0)
            {
                image.ConvertTo24BppRGB(imageId);
                PixelFormat pf = image.GetPixelFormat(imageId); // px = PixelFormat.Format24bppRgb
                GdPictureStatus status = image.RemoveHolePunch(imageId);
                image.SaveAsJPEG(imageId, Path.Combine(OutputDirectory, $"{DateTime.Now.Ticks}.jpg"));
                image.ReleaseGdPictureImage(imageId);
            }

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

Re: UnsupportedPixelFormat status while using RemoveHolePunch method

Post by Loïc » Sun Oct 08, 2017 3:59 pm

Hi,

Are you on the latest release?

This feature has been introduced recently.

With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests