PixelFormat.Format8bppIndexed produces grayscale image

Discussions about PDF management.
Post Reply
Username
Posts: 16
Joined: Wed Jul 18, 2012 12:11 am

PixelFormat.Format8bppIndexed produces grayscale image

Post by Username » Wed Jul 18, 2012 12:23 am

When I use GdPicturePDF.RenderPageToGdPictureImage with PixelFormat.Format8bppIndexed, it produces grayscale image. If pixel format is PixelFormat.Format4bppIndexed - a color image is produced. Why GdPicture decides to create color table when 4 bpp are used and grayscale table when 8 bpp are used ? What is the fastest way to convert PDF page to color 8 bit indexed TIFF ?

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

Re: PixelFormat.Format8bppIndexed produces grayscale image

Post by Loïc » Wed Jul 18, 2012 9:09 am

This is by design.
If you need a 8bpp color image you should render the page to a 32-bit bitmap, and then apply the color quantization algorithm of the GdPcitureImaging class: ConvertTo8bppQ().

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest