Hello, PNG

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • tinf

    Tiny inflate library (inflate, gzip, zlib)

  • CRC is a table and 5 lines of code. That's trivial.

    >zlib is 23k lines

    It's not needed to make a PNG reader/writer. zlib is massive overkill for only making a PNG reader or writer. Here's a tiny deflate/inflate code [2] under 1k lines (and could be much smaller if needed).

    stb[0] has single headers of ~7k lines total including all of the formats PNG, JPG, BMP,. PSD, GIF, HDR, and PIC. Here's [1] a 3k lines single file PNG version with tons if #ifdefs for all sorts of platforms. Removing those and I'd not be surprised if you could not do it in ~1k lines (which I'd consider quite simple compared to most of todays' media formats).

    >Of course they're not common formats so you're stuck with complex formats like PNG

    BMP is super common and easy to use anywhere.

    I use flat image files all the time for quick and dirty stuff. They quickly saturate disk speeds and networking speeds (say recording a few decent speed cameras), and I've found PNG compression to alleviate those saturate CPU speeds (some libs are super slow, some are vastly faster). I've many times made custom compression formats to balance these for high performance tools when neither things like BMPs or things like PNG would suffice.

    [0] https://github.com/nothings/stb

    [1] https://github.com/richgel999/fpng/blob/main/src/fpng.cpp

    [2] https://github.com/jibsen/tinf/tree/master/src

  • fpng

    Super fast C++ .PNG writer/reader

  • CRC is a table and 5 lines of code. That's trivial.

    >zlib is 23k lines

    It's not needed to make a PNG reader/writer. zlib is massive overkill for only making a PNG reader or writer. Here's a tiny deflate/inflate code [2] under 1k lines (and could be much smaller if needed).

    stb[0] has single headers of ~7k lines total including all of the formats PNG, JPG, BMP,. PSD, GIF, HDR, and PIC. Here's [1] a 3k lines single file PNG version with tons if #ifdefs for all sorts of platforms. Removing those and I'd not be surprised if you could not do it in ~1k lines (which I'd consider quite simple compared to most of todays' media formats).

    >Of course they're not common formats so you're stuck with complex formats like PNG

    BMP is super common and easy to use anywhere.

    I use flat image files all the time for quick and dirty stuff. They quickly saturate disk speeds and networking speeds (say recording a few decent speed cameras), and I've found PNG compression to alleviate those saturate CPU speeds (some libs are super slow, some are vastly faster). I've many times made custom compression formats to balance these for high performance tools when neither things like BMPs or things like PNG would suffice.

    [0] https://github.com/nothings/stb

    [1] https://github.com/richgel999/fpng/blob/main/src/fpng.cpp

    [2] https://github.com/jibsen/tinf/tree/master/src

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • figlet-fonts

    my collection of figlet / toilet ascii art fonts

  • Oh nice! That seems to be using the tool 'figlet' (or maybe toilet, from libcaca), and the font is banner3-D, that's available here: https://github.com/xero/figlet-fonts

    If you install the figlet (or toilet) tool and clone that font repo you can do a :

      figlet -d ./figlet-fonts -f Banner3-D My text

  • PNG-library

    Easy, safe, flexible Java library to decode and encode PNG image files

  • Having implemented most of the PNG specification from scratch in the past month, I agree with all of the features highlighted by the author in the article's introduction. Although there are some minor things I don't like, overall it is a very well-designed format that has minimal ambiguity and stands the test of time.

    You can find my modern Java PNG library at: https://www.nayuki.io/page/png-library , https://github.com/nayuki/PNG-library

  • basis_universal

    Basis Universal GPU Texture Codec

  • Erm, aren't both WebP and PNG rather useless for games? How do you convert those formats into one of the hardware-compressed texture formats consumed by the GPU (like BCx, ETC or ASTC)? Without those you're wasting a ton of GPU memory bandwidth when sampling textures.

    (there are some alternatives, like https://github.com/BinomialLLC/basis_universal, or http://www.radgametools.com/oodletexture.htm)

  • pics

    File formats dissections and more...

  • libpng

    LIBPNG: Portable Network Graphics support, official libpng repository

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • canvas_ity

    A tiny, single-header <canvas>-like 2D rasterizer for C++

  • stb

    stb single-file public domain libraries for C/C++

  • CRC is a table and 5 lines of code. That's trivial.

    >zlib is 23k lines

    It's not needed to make a PNG reader/writer. zlib is massive overkill for only making a PNG reader or writer. Here's a tiny deflate/inflate code [2] under 1k lines (and could be much smaller if needed).

    stb[0] has single headers of ~7k lines total including all of the formats PNG, JPG, BMP,. PSD, GIF, HDR, and PIC. Here's [1] a 3k lines single file PNG version with tons if #ifdefs for all sorts of platforms. Removing those and I'd not be surprised if you could not do it in ~1k lines (which I'd consider quite simple compared to most of todays' media formats).

    >Of course they're not common formats so you're stuck with complex formats like PNG

    BMP is super common and easy to use anywhere.

    I use flat image files all the time for quick and dirty stuff. They quickly saturate disk speeds and networking speeds (say recording a few decent speed cameras), and I've found PNG compression to alleviate those saturate CPU speeds (some libs are super slow, some are vastly faster). I've many times made custom compression formats to balance these for high performance tools when neither things like BMPs or things like PNG would suffice.

    [0] https://github.com/nothings/stb

    [1] https://github.com/richgel999/fpng/blob/main/src/fpng.cpp

    [2] https://github.com/jibsen/tinf/tree/master/src

  • fpnge

    Demo of a fast PNG encoder.

  • But most platforms these days have some form of CRC32 "acceleration". Adler32 is easy to compute so I'm even less concerned there.

    I spent a bunch of time optimising the code in [fpnge](https://github.com/veluca93/fpnge), which is [often notably faster than fpng](https://github.com/nigeltao/qoir/blob/5671f584dcf84ddb71e28d...), yet checksum time is basically negligible.

    Having said that, the double-checksum aspect of PNG does feel unnecessary.

  • qoir

    A fast, simple, lossless image file format.

  • But most platforms these days have some form of CRC32 "acceleration". Adler32 is easy to compute so I'm even less concerned there.

    I spent a bunch of time optimising the code in [fpnge](https://github.com/veluca93/fpnge), which is [often notably faster than fpng](https://github.com/nigeltao/qoir/blob/5671f584dcf84ddb71e28d...), yet checksum time is basically negligible.

    Having said that, the double-checksum aspect of PNG does feel unnecessary.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts