@alcinnz
The reference I would look to for #DEFLATE (#PNG) compression would be #opticl ; while it's lovely #lisp native, I think the implementation of #DEFLATE includes non-portable (in some sense) hardware acceleration to speed up de/compression. https://github.com/slyrus/opticl

I believe #opticl is used by #mcclim ansi #clim2 implementation, for example. #commonLisp. Even if you're not working in lisp, lisp is natural to absorb ideas from.
@vertigo

GitHub - slyrus/opticl: An image processing library for Common Lisp

An image processing library for Common Lisp. Contribute to slyrus/opticl development by creating an account on GitHub.

GitHub