[Mono-winforms-list] libgdiplus/System.Drawing patch: native support for indexed Bitmaps

Jonathan Gilbert 2a5gjx302@sneakemail.com
Wed, 16 Mar 2005 15:35:03 -0500


At 02:08 PM 16/03/2005 -0300, Fabian Luque wrote:
>> Probably the cleanest way to remove the warning, without making the code do
>> an extra assignment when it doesn't have to, is to add a 'default' block
>> that sets it to 'NULL':
>> 
>>         default: default_palette = NULL;
>
>After making this change, libgdiplus compiled just fine.
>
>Now, when I open my 1bpp TIFF file and the save it to PNG I'm still
>getting a 32bpp 180 KB file instead of a 1bpp file around 80 KB.

The problem here is that because the TIFF format is massive and complex, I
decided to postpone indexed TIFF loading support for a later patch. This
patch does not alter the way the TIFF codec loads TIFF files, and as such
they are upsampled to 32bpp at load time. Then, when you go to save the
Bitmap, the PNG codec says "hmm, this is a 32-bpp RGB Bitmap object, so
I'll make a 24-bit RGB PNG file".

Is it possible for you to pre-convert the TIFFs to another format, like BMP
or PNG, or is this the whole point of what you were trying to accomplish
using System.Drawing? :-)

Jonathan Gilbert