Skip to main content
100%

Gist f760b119be511c3b97e0f496b4dc1e1c

✓ Published0🌍 Public
SSohojoe
Last edited Oct 1, 2021
Created on Oct 1, 2021

This example demonstrates a custom lossless image compression algorithm that encodes 16x16 pixel art using Sharp for image processing and node-base91 for encoding. It converts between 4-bit and 8-bit color formats to preserve the original artistic intent, as seen with the reference star and zero images. The code includes functions for converting RGB values to and from short hex codes, and encodes image data through Sharp's WebP lossless format before base91 encoding. The visualization shows compression results as encoded strings, verifying that the algorithm successfully reproduces the original images through lossless decoding.

AI-generated description

Similar vizzes