Skip to content
项目

关于

将任意图像转换为纯 CSS,仅使用 box-shadow 重现图像。

网站与应用开发

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
+1
1个月
+10

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

img2css

Convert any image to pure CSS.

img2css

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 <img> 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.

探索相关项目

加载中…