What Is an Image to CSS Art Converter?
This tool transforms a raster image into pure CSS โ rendering every pixel as a box-shadow value on a single HTML element. The result is a visual reproduction of your photo built entirely from CSS, with no <img> tag or background-image in sight. It is part art experiment, part technical showcase.
Upload any image, choose your pixel resolution (lower means more abstract, higher means more faithful), and the tool generates the CSS instantly. The output is a single div with hundreds or thousands of box-shadow declarations that paint the image pixel by pixel. Copy it, paste it into a CodePen, and watch people wonder how it is done.
How to Use This Tool
- Upload your source image โ Drag and drop or select any JPG, PNG, or WebP file. Smaller, simpler images with bold colors work best for recognizable results.
- Set the pixel resolution โ Resolution sets how many cells the image is resampled to across (8 to 128; rows follow the aspect ratio). Pixel Size sets how big each cell is drawn (1 to 16 px). Low resolution gives chunky pixel art; high resolution keeps more detail but grows the CSS fast.
- Preview the CSS rendering โ The tool shows a live preview of the CSS art next to your original image so you can compare fidelity and adjust resolution before exporting.
- Copy the generated CSS โ Click the copy button to grab the CSS. Paste it into any HTML file โ the art is a single div with an inline or stylesheet-defined box-shadow property.
Worked example: CSS size for a 16:9 photo
On October 12, 2026 we loaded a 1920 ร 1080 photo into the tool in Chromium 141, stepped the Resolution slider through five values in box-shadow mode and measured the CSS copied with Copy CSS, plus its gzip size (what a server sends).
| Resolution | Grid | Shadows | CSS | gzip -9 |
|---|---|---|---|---|
| 16 | 16 ร 9 | 144 | 4.0 KB | โ |
| 32 | 32 ร 18 | 576 | 15.7 KB | โ |
| 48 (default) | 48 ร 27 | 1,296 | 35.7 KB | 8.3 KB |
| 64 | 64 ร 36 | 2,304 | 63.8 KB | โ |
| 128 (maximum) | 128 ร 72 | 9,216 | 257.9 KB | 58.2 KB |
- Size grows with the square of the resolution. Each shadow costs about 28 bytes, so doubling the resolution quadruples the CSS: 64 โ 128 went from 64 KB to 258 KB. A square image has more rows than a 16:9 one at the same setting (64 ร 64 = 4,096 shadows, about 115 KB).
- gzip helps a lot, but not enough for photos. The 128-wide export compresses to 58 KB, while the same 128 ร 72 picture saved as a PNG is 19 KB (lossless WebP 17 KB), so a scaled-up image with CSS image-rendering: pixelated gives the same look for a third of the bytes. Use the CSS for demos and pixel art, not to replace images.
- Rows follow the aspect ratio. Resolution sets the number of cells across; a 16:9 photo at 48 gives 48 ร 27 cells, each drawn Pixel Size pixels wide (6 px by default, so 288 ร 162 px on screen).
- Grid mode moves the cost into HTML. One div per cell means 1,296 elements at the default resolution; that is more DOM to lay out than one element with 1,296 shadows.
Sources
Checked on .
Frequently Asked Questions
๐ Learn More
Related Article CSS Shapes: Dividers & Triangles โ Related Article CSS Loading Animations, Filters & Glow Effects โBuilt by Derek Giordano ยท Part of Ultimate Design Tools