Tkpng

Jul 20, 2023

PNG support for Tcl/Tk

This port implements support for loading and using PNG images with Tcl/Tk. Although other extensions such as Img also add support for PNG images, I wanted something that was lightweight, did not depend on libpng, and which would be suitable for inclusion in the Tk core, as Tk does not currently support any image formats natively that take advantage of its internal support for alpha blending, and alpha antialiasing and drop shadows really go a long way toward beautifying Tk applications.

At this time, the package supports reading images from files or binary data. Base64 decoding is supported as of version 0.6. Exporting images to PNG format is not supported yet.

The package supports the full range of color types, channels and bit depths from 1 bit black & white to 16 bit per channel full color with alpha 64 bit RGBA and interlacing. Ancillary “chunks” such as gamma, color profile, and text fields are ignored, although they are checked at a minimum for correct CRC.



Checkout these related ports:
  • Zphoto - Zooming photo album generator
  • Zint - Barcode generator (library and utilities)
  • Zimg - Image-generator that uses ASCII input files to create PNGs/EDFs
  • Zgv - Graphics viewer for SVGAlib
  • Zbar - ZBar barcode reader
  • Zathura - Customizable lightweight pdf viewer
  • Zathura-ps - PostScript support for Zathura PDF viewer
  • Zathura-pdf-poppler - Poppler render PDF plugin for Zathura PDF viewer
  • Zathura-pdf-mupdf - MuPDF render PDF plugin for Zathura PDF viewer
  • Zathura-djvu - DjVu support for zathura
  • Zathura-cb - Comic book plugin for Zathura PDF viewer
  • Yukon - Real-time capture tool for OpenGL applications
  • Yed - Editor for graphs and diagrams
  • Yafaray - Montecarlo raytracing engine
  • Yacreader - Yet another comic reader