img2css
v0.0.3
Published
Convert any image into pure CSS
Downloads
10
Readme
img2css
This works by encoding each pixel of the source image as a 1x1 box-shadow of the correct color.
Yes, this is a hack and shouldn't be used in production.
Command line tool
img2css
can be used as a command line tool. It takes a path to an image as
input, and outputs the CSS code.
# Install it globally
yarn add --global img2css
# Convert an image
img2css ./profile.jpg
npm module
img2css
can be used as a dependency, to use in your own scripts.
Install it with yarn add img2css
, then use it in your scripts:
const img2css = require('img2css');
const css = await img2css('./profile.jpg');
Online demo tool
Visit https://projects.pixelastic.com/img2css/demo for an online demo.
Documentation
The complete documentation can be found on https://projects.pixelastic.com/img2css/