Hacker News new | ask | show | jobs
by 082349872349872 2109 days ago
Don't know a simple example: when I did trivial encoding[1], it was by reading the spec. Dim memories for keeping it simple: choose an advantageous bit depth and palette so your non-lzw'd data can trivially be written out bytewise per pixel. If you can control width to avoid line padding, even better.

(Yet dimmer, possibly false, memories: by taking advantage of LZW literals, I think it's possible to unencodedly write supposedly encoded blocks?)

[1] 10-50 lines of python, depending upon fanciness, IIRC