npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pai-converter

v0.1.5

Published

Pixel Art Image Converter

Downloads

1

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

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