Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shinnn/smallest-png

Create a buffer of theoretically smallest PNG
https://github.com/shinnn/smallest-png

Last synced: 26 days ago
JSON representation

Create a buffer of theoretically smallest PNG

Awesome Lists containing this project

README

        

# smallest-png

[![npm version](https://img.shields.io/npm/v/smallest-png.svg)](https://www.npmjs.com/package/smallest-png)
[![Github Actions](https://action-badges.now.sh/shinnn/smallest-png)](https://wdp9fww0r9.execute-api.us-west-2.amazonaws.com/production/results/shinnn/smallest-png)

A `Buffer` of [the theoretically smallest PNG](https://github.com/mathiasbynens/small/blob/master/png-transparent.png)

```javascript
const smallestPng = require('smallest-png');
//=>

smallestJpeg.length; //=> 67
```

Suitable for test fixtures.

```javascript
const {width, height} = somePngParserFunction(smallestPng);

console.assert(width === 1);
console.assert(height === 1);
```

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/).

```
npm install smallest-png
```

## API

```javascript
const smallestPng = require('smallest-png');
```

### smallestPng

Type: [`Buffer`](https://nodejs.org/api/buffer.html#buffer_class_buffer)

## Related

* [smallest-jpeg](https://github.com/shinnn/smallest-jpeg) — A [JPEG](https://jpeg.org/jpeg/) version

## License

[MIT No Attribution](./LICENSE) © 2019 Watanabe Shinnosuke