Page 1 of 1

PNG 256 colors and transparency

Posted: Fri Jun 03, 2005 3:40 pm
by Ithier
Hi,
I have a 256 colors PNG file with transparency.
If I just load the file and then save it also in PNG the transparency is lost. How can I keep it ?
Thanks in advance

Ithier

Here is my code:

Code: Select all

#include "libgfl.h"

int main(int argc, char *argv[])
{
	gflLibraryInit();

	GFL_LOAD_PARAMS load_option;
	gflGetDefaultLoadParams( &load_option );
    GFL_FILE_INFORMATION    GflFI;
    GFL_BITMAP*     GflBitmap;
	gflLoadBitmap(argv[1], &GflBitmap, &load_option, &GflFI);

   	GFL_SAVE_PARAMS save_option;
    gflGetDefaultSaveParams(&save_option);
    save_option.FormatIndex = gflGetFormatIndexByName("png");
    gflSaveBitmap("o.png", GflBitmap, &save_option);
	return 0;
}

Re: PNG 256 colors and transparency

Posted: Sat Jun 04, 2005 2:52 pm
by xnview
Ithier wrote:Hi,
I have a 256 colors PNG file with transparency.
If I just load the file and then save it also in PNG the transparency is lost. How can I keep it ?
Thanks in advance

Ithier

Here is my code:
Could you send me your file, please?