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);
}