Wednesday, April 09, 2008

Erlang R12B-2 released - with native PNG drawing

It's a bugfix release and I had no big expectations when scanning through the release notes, but then I spotted this:
--- percept-0.7 ------------------------------------------------------------

OTP-7162 Percept no longer depends on external c-libraries. The
graphical rendering is now done via erlang code.
Thats huge, if you are interested in generating PNG images and don't wanna have dependencies on c-libraries (as you would have using my cairo wrapper erlycairo). Egd won't win any speed competition and has a limited feature set, but runs out of the box on any Erlang supported platform !

4 comments:

Ulf Wiger said...

Nice catch! I missed that one. Perhaps the module should be in some other place than in percept, though...

BTW, I once thought I'd write a GIF library in Erlang, but got fed up trying to write LZW compression code using pre-bit-syntax Erlang. Even with the initial bit syntax, it would have been a pain, what with all the padding needed. With bitstrings, I imagine that there would be no pain at all. (:

This issue popped up a few times on the mailing list (e.g. here)

Roberto Saccon said...

Ulf, thanks for the info. GIF is great for alternatively generating IE6 compatible images with alpha transparency, because IE cannot deal with the opacity of PNG imagaes.

Gleber said...

Roberto, that's not fully correct. As far as i know, IE6 has problems with partial-transparent PNG (ie. PNG24 with 8bit alpha channel for different pixels), but it is capable of displaying PNG8 aka pallete-PNG with 1bit transparency (similar to GIF). Hence if percept's PNG-writer supports PNG8 there is no need for GIF library :)

Roberto Saccon said...

Gleber, thanks for pointing to this, I have no experience yet with palette-based PNG8, but if egd could create it, then we would have e full Web imaging Erlang solution (with probably ugly images on IE6, because PNG8 / PNG24 differences)