Convert PNG to CSS Box-Shadow Art
Redraw a small PNG with one HTML element and a box-shadow per pixel. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
Drop an image anywhere on this page
or paste with Ctrl / ⌘ + V ·
Accepts PNG
Your PNG files never leave this tab
Convert PNG to CSS Box-Shadow Art is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, 200 photos straight off a camera means 1.6 GB uploaded, a wait in somebody's queue, and 240 MB downloaded again. Here it means 0 bytes up and 0 bytes down.
- No upload
- No file size limit
- Works offline once loaded
- Nothing stored or logged
How to use Convert PNG to CSS Box-Shadow Art
- 1. Drop in a small PNG. Add an icon, sprite or other small graphic. Bigger pictures are scaled down to the max size you set, since every pixel becomes one line of CSS.
- 2. Choose the pixel size and output. Set how large each pixel is drawn in CSS pixels, the class name, and whether you want a ready HTML snippet or just the CSS rule.
- 3. Copy the CSS. Paste the snippet into a page. One empty element draws the whole picture through its box-shadow list, with transparent pixels skipped and soft alpha kept.
When to use Convert PNG to CSS Box-Shadow Art
Convert PNG to CSS Box-Shadow Art redraws a picture with a single HTML element: each visible pixel becomes one shadow at its own offset and color. It is a CSS trick and a demo piece rather than a replacement for an image file.
- A pure CSS art demo. Show what one CSS property can do in a talk or a portfolio piece. A small pixel-art character drawn entirely with box-shadow always gets a reaction.
- Pixel art that scales cleanly. Change the pixel size and the art grows with hard edges, with no image smoothing to blur a sprite. It is handy for retro icons on a page.
- Testing how a browser copes. A box-shadow list with thousands of entries is a real stress test for style recalculation and painting, built from a picture you choose.
Examples
16×16 icon
Input
icon.png, pixel size 4
Output
.pixel-art { width: 4px; height: 4px; box-shadow: 0 0 #ff0000, ... }About the Convert PNG to CSS Box-Shadow Art tool
Convert PNG to CSS Box-Shadow Art does its work locally, right in the browser. Redraw a small PNG with one HTML element and a box-shadow per pixel. There is no upload step, no queue and no account, and your data never travels over the network.
It belongs to the PNG Tools collection on EditSafely, a set of 292 small, focused PNG utilities that share the same instant, private workspace.
You can shape the output with 4 settings, including Max pixels per side (larger PNGs are downscaled), Size of each pixel (CSS px), Output and Class name; the result is redone automatically when you change one. A worked example further down the page shows exactly what the tool produces for a real input.
Running locally also makes the tool fast and dependable: the image is read straight from your device the moment you drop it, there is no server outage that can take it down mid-task, and private pictures stay private.
Frequently asked questions
Is Convert PNG to CSS Box-Shadow Art free to use?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Are my files uploaded to a server?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
Which files does Convert PNG to CSS Box-Shadow Art accept?
It accepts PNG images. There is no file size cap imposed by a server; very large files are limited only by your device's memory.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
How do I use the result?
Click Copy to put it on your clipboard, or Download .txt to save it as a file. Drop another image to start again.
Related tools
All PNG Tools →Convert PNG to HTML Canvas Code
Turn a PNG into JavaScript that redraws it on an HTML canvas, pixel for pixel.
Convert PNG to CSS Sprite Code
Find every sprite in a PNG sheet and write a CSS class with its size and background-position.
Pixelate a PNG
Cluster smooth pixels into retro blocks to mimic classic video games or hide detail.