Login
You're viewing the ruby.social public feed.
  • Nov 27, 2026, 4:56 PM

    Upon finishing a row it might zero out a final buffer, zero out the temporary buffer, iterates over each pixel using helpers to colour-correct & either dither or quantize each pixel before bitpacking them, tells the ditherer if any that we're on a new row, & writes it out to the file. Or a variant might average adjacent pixels before applying similar logic to output the downsampled image.

    There's an init callback which initializes its buffers & metadata from the image's metadata.

    2/3!

    💬 1🔄 1⭐ 0

Replies

  • Nov 27, 2026, 5:03 PM

    The core routine inits a PNGLE library propagating failures followed by this wrapper's own data, configures the callbacks with that userdata, feeds a chunk at a time to PNGLE while handling aborts & errors, & cleans up reporting failures. And there's 2 public routines lightly wrapping this.

    The GfxRenderer support library provides helpers to convert RGB to gray (by summing values from lookup tables), performs various colour-correction to improve legibility, & quantize the grays.

    3/3.2!

    💬 1🔄 1⭐ 0
  • Nov 27, 2026, 5:06 PM

    Also this GfxRenderer support class provides a few different support classes for dithering, or it can fold into the quantization using hash-based noise.

    I suspect that these image-converts were some of the earliest code written in Papyrix (or its upstream "Crosspoint") as that would explain the redundant routines.

    3.3/3.3 Fin for today! Tomorrow: PNGLE!

    💬 0🔄 1⭐ 0