delphi - How can I convert PNG to GIF keeping the transparency? -


how can convert png gif keeping transparency?

i have hoped using assign( ) method work doesn't seem migrate transparency. in gif, it's represented black.

    png:=tpngimage.create;     try       png.loadfromfile(sfile);       // comes file:  png.transparencymode;       // comes file:  png.transparent        // didn't help:  gif.transparent:=true;        gif.assign(png);        // didn't help:  gif.transparent:=true;        gif.savetofile('e:\tmp\out.gif');           png.free;     end; 

i haven't found way handle in delphi...

thanks!

it possible transfer image png gif. however, don't recommend so. gif format substantially less capable png. png supports rgba color channels , partial transparency. gif uses 256 color palette , no support partial transparency.

there many libraries available make best of bad job , attempt produce gif image close png image, information lost.

the gif format dates late 1980s , time has moved on. has long since served purpose. png modern, capable , supported. if possible should switch gif using png.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -