<atk-img> — your 1-stop shop for 1-bit color images

Pixel-perfect Atkinson error-diffusion dither, contrast-limited adaptive histogram equalization, and duotone processing in SIMD-optimized Wasm, in a tiny Web Component, which gracefully degrades to a regular image.

demo image

Download the component or copy a self-contained code snippet

Usage

Wrap your <img> in an <atk-img>, and use the attributes enhance, color, background, and scale, which you can play with above.

<atk-img enhance scale="2" color="#062800" background="#e0ffd9">
	<img src="img.webp" alt="image description" width="1024" height="683">
</atk-img>

Known alternatives

Source codes: https://codeberg.org/owl/atk-img