Hi,
When convert an indexed BMP image to jpeg, an exception is throw saying "A Graphics object cannot be created from an image that has an indexed pixel format."
So does Aspose.Imaging support indexed BMP image currently? If yes, what should I do? or is there any plan to support this feature next version?
Thanks
Hi,
Thank you for contacting support.
Indexed BMP images are supported for 1, 4 and 8 bits per pixel with palette. Below is the sample source for your reference.
C#
BmpOptions options = new BmpOptions();
options.BitsPerPixel = 8;
options.Compression = BitmapCompression.Rgb;
options.Palette = new ColorPalette(new Color[] { Color.Red, Color.Green, Color.Blue });
options.Source = new FileCreateSource(“C:\test_indexed_bmp.bmp”, false);
using (Image image = Image.Create(options, 100, 100))
{
image.Save(“C:\test_indexed.jpg”, new JpegOptions());
}
In case your problem persists, we would like to review your sample image as well as sample code to further investigate your said issue. Please share this information so we may start looking into this matter.
Regards,