0.1.5 • Published 2 years ago

pai-converter v0.1.5

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

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

NameSizePAI SizePNG Size
Bassalt16x16712 bytes3370 bytes
Block16x1650 bytes131 bytes
Smiley16x16219 bytes410 bytes
Brick32x3278 bytes184 bytes
Tree64x64355 bytes740 bytes

Installation

# Using NPM:
npm i pai-converter

# Using Yarn:
yarn add pai-converter

Getting Started

Import the package:

import { toPaiImage, paiToImage } from 'pai-converter';

Now you can save convert images to and from PAI and PNG!

Convert to PAI from PNG:

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:

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 :)
0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago