GIF or PNG Creation/Encoding Library?

Does anyone know of a library or binding for creating/encoding either GIF or PNG images in Ada?

I found the following, don’t know anything about it:

@zertovitch has gid on alire, a crate that decodes images and possibly encodes animated gifs (I say that based on a blog post of his) but there’s no documentation and my quick scan of the code didn’t reveal encoders.

Does it have to be GIF or PNG? I am working on a library crate for PNM at the moment. It’s nowhere near ready, and nowhere near efficient, but PNM’s can be converted to GIFs with an external program. Eventually I wanted to add GIF and/or PNG.

Other than the already mentioned PNG binding, there is also this:

With GIF you are limited to 256 colours; usually the result is not so nice…
You can also have a look at QOI.
There is an Ada encoder & decoder for it @

It corresponds to the “qoi” Alire crate.

:slight_smile: I’ve already hand-coded PPM and PAM encoders for my project. I was seeking something natively displayable in browsers and on desktops without external programs.

QOI looks nice, but not (yet) supported by browsers or most desktops.

I spent a day trying to get PNG_IO to work, in the end I failed with linking errors for zlib…

In the meantime I’ve coded up a simple (uncompressed) GIF encoder which I’ll enhance over the next few days.

1 Like