# img2css

> Convert any image into pure CSS

Latest version **0.0.3** (published 2022-03-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install img2css
pnpm add img2css
yarn add img2css
bun add img2css
```

Provides the command `img2css`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2022-03-26 |
| First published | 2022-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.17.0 |
| Dependencies | 5 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Tim Carry |
| Maintainers | pixelastic |

## Links

- npm: https://www.npmjs.com/package/img2css
- Repository: https://github.com/pixelastic/img2css
- Homepage: https://projects.pixelastic.com/img2css/
- Issues: https://github.com/pixelastic/img2css/issues
- npm.io page: https://npm.io/package/img2css

## Dependencies (5)

- [dedent](https://npm.io/package/dedent.md) 0.7.0
- [golgoth](https://npm.io/package/golgoth.md) 2.1.0
- [rgb-hex](https://npm.io/package/rgb-hex.md) 3.0.0
- [prettier](https://npm.io/package/prettier.md) 2.6.1
- [image-pixels](https://npm.io/package/image-pixels.md) 2.2.2

## Recent versions

- 0.0.3 (latest) — 2022-03-26
- 0.0.2 — 2022-03-26

## README

<!--
  This page was automatically generated by aberlaas readme.
  DO NOT EDIT IT MANUALLY.
-->

# img2css

<div class="lead">
  Convert any image into pure CSS. No specific markup required, only one CSS
  class.
</div>

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.

```sh
# 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:

```js
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/

---
_Source: https://npm.io/package/img2css · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
