Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/javierbyte/img2css
Convert any image to pure CSS. Recreates images using only box-shadows.
https://github.com/javierbyte/img2css
css design design-tool frontend img2css javascript pixel-art react
Last synced: 8 days ago
JSON representation
Convert any image to pure CSS. Recreates images using only box-shadows.
- Host: GitHub
- URL: https://github.com/javierbyte/img2css
- Owner: javierbyte
- License: bsd-3-clause
- Created: 2015-10-16T08:10:06.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-04-20T08:37:06.000Z (over 1 year ago)
- Last Synced: 2024-10-29T17:40:20.653Z (about 2 months ago)
- Topics: css, design, design-tool, frontend, img2css, javascript, pixel-art, react
- Language: JavaScript
- Homepage: https://javier.xyz/img2css/
- Size: 5.89 MB
- Stars: 2,484
- Watchers: 64
- Forks: 189
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# [img2css](https://javier.xyz/img2css/)
Convert any image to pure CSS.
[![img2css](public/img2css.jpg)](https://javier.xyz/img2css/)
- 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
Run development server:
```
npm run dev
```Build
```
npm run build
```