Converting 24BPP to 4BPP with GDI+ in VB.NET
- by Chris
My VB.NET program currently takes a 4BPP TIFF as an Bitmap, converts it to a Graphic, adds some text strings and then saves it out again as a TIFF file. The output Bitmap.Save() TIFF file by default seems to be 24BPP (regardless of the input) and is a lot larger than the original TIFF.
Is it possible to keep the same 4BPP palette encoding as the input for the output and if not, how can I convert my Bitmap PixelFormat from 24BPP to 4BPP Indexed.
I've seen an example for converting 24 BPP to 1 BPP at http://www.bobpowell.net/onebit.htm using BitmapData.Lockbits() but cannot figure out how to do it for 4BPP.
Many thanks
Chris