PNG image en- and de-coders.. 2020 update

Andy Balba pwplus7 at
Tue Aug 11 18:29:28 UTC 2020

Found this 2012 Forum post :$2lt9$
and thought that D-folks interested in this topic may find an 
"update" helpful.

FWIW here's my contribution to such an update (others obviously 
has a very quick learing curve and allows easy extraction all 
code related to encoding and decodeing PNG images into a single 
The PNG code handles 8- and 16-bit color depths, gary colors, 
gray+alpha, RGB and RGBA. This code also offers en- and de-coding 
of BMP and TGA, and de-coding only of JPEG; but my interest is 
PNG only.

To this extracted module I've added other modules /functions for :
* commonly used color transformation functions e.g. 
rgb_to_ycbcr(), RGB_to_gray(), wave_length_nm_to_rgb()
* various RGB color-maps
* a Cartesian system that transforms 2D X-Y Cartesian 
co-ordinates into xy screen coordinates allowing one to create 
images using X-Y instead of screen co-ordinates
* several utility functions

More information about the Digitalmars-d mailing list