Description
img2css converts any image into CSS, so the picture can be shown without an image file. It offers two outputs. The first is a pure CSS shadow matrix, where the image is resized and each pixel becomes a box-shadow on a single-pixel element, so no img tag or background-image is needed. The project says this output can be very large and is not recommended for production unless there is no other option. The second output embeds the whole image file in base64 inside the page, so no external hosting is needed. You use the tool in the browser on the project's website, and there is a separate programmatic route for people who want to do the conversion in code. The author also built a per-pixel animation experiment that uses the same idea. The project is a static site: running the build writes the output to an out folder, and pushing to the main branch deploys it to the gh-pages branch that serves the website. The source is public on GitHub, and the README explains how the two outputs work in a short section.…
Highlights
- Converts any image to pure CSS box-shadows
- Base64 output that embeds the image
- No image file or hosting needed
- Runs in the browser on the project site
- Static site build with pnpm
Ratings & Reviews
No ratings yet
Be the first to rate Img2css.
People also visit
Img2css FAQ
What does img2css do?
It converts an image into CSS, either as a grid of box-shadows or as a base64 embedded image.
Is it free?
Yes. The project is open source and its code is on GitHub.
Should I use the pure CSS output in production?
The README does not recommend it for production unless there is no other option, because the output can be huge.
What is the base64 output?
The whole image file embedded inside an img tag, so the image needs no external hosting.
Is there a programmatic version?
Yes. The README points to a separate canvas image utilities project for doing the conversion in code.
How do I build the site?
Run pnpm build, which writes the static site to the out folder.
What are the best Img2css alternatives?
Popular alternatives to Img2css include Code to Image Converter, Colorffy and bennettfeely.com/clippy. See all Img2css alternatives







.gif?auto=compress&fit=max&w=128)
