Question

So I am experimenting with using icons in my CSS using base64 encoded pngs. I have used http://www.motobit.com/util/base64-decoder-encoder.asp to convert them. However, the pngs only have an 8bit alpha channel, the pixels are either fully opaque, or fully transparent, no partial transparency. This is leaving my icons with hard edges. Any ideas of a 24bit alpha channel is possible through base64_encode?

Was it helpful?

Solution

The encoder in that page may be buggy. I made a PNG with alpha channels in Photoshop, encoded it using PHP's base64_encode(), put it in an image, and it works. Take a look at this fiddle for HTML and this fiddle for CSS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top