Page 1 of 1

gflLoadBitmapFromMemory() and PNG ColorType 3 with Alpha

Posted: Thu Mar 25, 2010 4:30 pm
by Ralf
i'm using gflLoadBitmapFromMemory() on a PNG file image with ColorType 3 (indexed color) and transparency chunk which stores the Alpha channel for the LUT.

Code: Select all

    GFL_LOAD_PARAMS     load_params;
    gflGetDefaultLoadParams( &load_params );
    load_params.Flags = GFL_LOAD_ORIGINAL_DEPTH | GFL_LOAD_FORCE_COLOR_MODEL;
    load_params.ColorModel = GFL_RGBA;

    GFL_BITMAP          *p_bitmap = 0;
    GFL_ERROR const     gfl_error = gflLoadBitmapFromMemory( reinterpret_cast<GFL_UINT8 const *>(pIn), filled, &p_bitmap, &load_params, NULL );
unfortunately the bitmap returned by gflLoadBitmapFromMemory() apparently ignores the Alpha channel from the PNG and returns image data with an Alpha value of 0xFF for all pixels (tested with GFL SDK 2.82 and 3.11) :(

we'd really appreciate a fix for this!

Re: gflLoadBitmapFromMemory() and PNG ColorType 3 with Alpha

Posted: Fri Mar 26, 2010 2:27 pm
by xnview
Alpha for 8 bits colors PNG can't be loaded...