Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

img2css

> 前端框架
Open source

Convert any image to pure CSS. Recreates images using only box-shadows.

2.5K stars0 likes0 views
WebsiteGitHub

About

Convert any image to pure CSS. Recreates images using only box-shadows.

img2css

Convert any image to pure CSS.

  • To use it go to https://javier.xyz/img2css
  • Looking for a programmatic way to do this? See https://github.com/javierbyte/canvas-image-utils
  • I also made a per-pixel animation experiment, see https://github.com/javierbyte/morphin

How does it work?

It has two different outputs, pure css shadow matrix [1] and base64 embedded image [2].

  • Pure CSS: This output was created by resizing and setting each pixel as a box-shadow of a single pixel div, so no img tag or background-image is needed. This can result in huge outputs, and the use of this output is not recommended for production unless there is no other option.
  • Base64: The entire image file is embedded inside the `` tag using base64, so no need external hosting is needed.

Development

pnpm install
pnpm dev

pnpm build writes the static site to out/. Pushing to main deploys it to the gh-pages branch, which javier.xyz/img2css serves.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptcssdesigndesign-toolfrontend

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架