# pai-converter

> Pixel Art Image Converter

Latest version **0.1.5** (published 2022-03-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install pai-converter
pnpm add pai-converter
yarn add pai-converter
bun add pai-converter
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.5 |
| Published | 2022-03-23 |
| First published | 2022-03-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 13.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | TeakIvy |
| Maintainers | teakivy |

## Links

- npm: https://www.npmjs.com/package/pai-converter
- npm.io page: https://npm.io/package/pai-converter

## Dependencies (5)

- [jimp](https://npm.io/package/jimp.md) ^0.16.1
- [brotli](https://npm.io/package/brotli.md) ^1.3.2
- [canvas](https://npm.io/package/canvas.md) ^2.9.0
- [lzutf8](https://npm.io/package/lzutf8.md) ^0.6.1
- [@types/brotli](https://npm.io/package/@types/brotli.md) ^1.3.1

## Recent versions

- 0.1.5 (latest) — 2022-03-23
- 0.1.4 — 2022-03-23
- 0.1.3 — 2022-03-23
- 0.1.2 — 2022-03-23
- 0.1.1 — 2022-03-23
- 0.1.0 — 2022-03-23

## README

# Pixel Art Image Converter
Pixel Art Image is a image format created just as a test, and because I had nothing better to do. Fun fact: this was a shower thought.

It is horribly implemented, but takes a smaller file size than PNG for most images it was designed for (Pixel Art)

## Size Comparison
| Name        | Size           | PAI Size  | PNG Size  |
| ------------- |---------| -----| -----|
| Bassalt      | 16x16  | 712 bytes | 3370 bytes |
| Block      | 16x16  | 50 bytes | 131 bytes |
| Smiley      | 16x16  | 219 bytes | 410 bytes |
| Brick      | 32x32  | 78 bytes | 184 bytes |
| Tree      | 64x64  | 355 bytes | 740 bytes |

## Installation
```sh
# Using NPM:
npm i pai-converter

# Using Yarn:
yarn add pai-converter
```

## Getting Started
### Import the package:
```js
import { toPaiImage, paiToImage } from 'pai-converter';
```
Now you can save convert images to and from PAI and PNG!

### Convert to PAI from PNG:
```js
import { toPaiImage } from 'pai-converter';

toPaiImage('smiley.png', {
	seperators: { pixel: '@', line: '&', size: ':', multiLine: 'x' },
	quality: 11,
	writeToFile: true,
	fileName: 'smiley.pai',
});
```

### Convert to PNG from PAI:
```js
import { paiToImage } from 'pai-converter';

paiToImage('smiley.pai', 'smiley-converted.png');
```

## Closing Note
- I'm not going to document the rest of this unless there is actually a want, but it is created in Typescript and therefor has types and interfaces :)

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