PNG 256 colors and transparency

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

User avatar
Ithier
Posts: 47
Joined: Fri Nov 19, 2004 10:50 am
Location: Paris, France

PNG 256 colors and transparency

Post 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;
}
User avatar
xnview
Author of XnView
Posts: 45870
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: PNG 256 colors and transparency

Post 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?
Pierre.