Pixel UI/Media/Pixel image

Pixel image

Any picture, dithered, mosaicked or halftoned on the GPU, with a lens.

<piix-pixel-image>WebGL
Effect
Palette
Lens

Shows your image as dithered pixels in the palette, as a mosaic, or as halftone dots. Move the pointer over it and a lens shows the real picture underneath; hover a mosaic and it resolves. It crops like object-fit: cover, and keeps the image's shape if you don't give it a height.

Installation

<!-- once, anywhere on the page: every component -->
<script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>

Usage

<piix-pixel-image src="../site/launch-poster.jpg" alt="The Piixpal launch film" height="380px"></piix-pixel-image>

Examples

Three effects

API reference

AttributeWhat it doesDefault
srcthe image (on your site, or served with CORS)–
altwhat it shows, for screen readers–
effectdither mosaic halftonedither
palettethe colours: lime aurora sunset ocean candy violet fire gameboy paper mono, or your own, dark to light: "#000,#6b4cff,#fff"mono
pixelsize of one pixel, in px3
lensnone turns the lens off–
heightany CSS lengththe image's own shape

Accessibility