Skip to content
Advertisement

Tag: png-8

How to convert PNG to 8-bit PNG using PHP GD library

I want to write a routine which takes PNG image path as parameter and convert that image into 8-bit PNG image. I need to use PHP GD library for this. Answer To convert any PNG image to 8-bit PNG use this function, I’ve just created function convertPNGto8bitPNG () Parameters $sourcePath – Path to source PNG file $destPath – Path to

PHP gdLib 8-Bit PNG with alpha

how is it possible to save my image, created with gd, as an png-8? it saves as gif with transparent channel well – but I want to use png-8. Best Regards, Beerweasle Answer Using imagesavealpha() and a transparent bg color should do the trick… Based on dfilkovi’s code:

Advertisement