Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rogeriopvl/8bit
🎮 Transform images into pixelated artwork
https://github.com/rogeriopvl/8bit
8bit image npm pixel pixelate
Last synced: 5 days ago
JSON representation
🎮 Transform images into pixelated artwork
- Host: GitHub
- URL: https://github.com/rogeriopvl/8bit
- Owner: rogeriopvl
- License: mit
- Created: 2015-09-24T21:26:32.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-17T07:32:53.000Z (over 1 year ago)
- Last Synced: 2024-09-19T17:17:38.703Z (about 2 months ago)
- Topics: 8bit, image, npm, pixel, pixelate
- Language: JavaScript
- Homepage:
- Size: 64.5 KB
- Stars: 92
- Watchers: 4
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 8Bit | ![CI status](https://github.com/rogeriopvl/8bit/actions/workflows/test.yml/badge.svg?branch=master)
8Bit is a javascript module that converts an image into a pixelated version using canvas.
You can find a demo [here](https://jsfiddle.net/fLajrmun/2/).
## Install
### NPM
npm install 8bit
### Bower
bower install 8bit
### Direct file link
## Usage
```javascript
var eightBit = require('8bit'); // only needed for NPM installsvar img = new Image();
img.onload = function () {
eightBit(document.getElementById('mycanvas'), img, 10);
};
img.src = 'http://foobar.com/your_image.png';
```### API
- `eightBit(canvas, image, scaleFactor)`
- `canvas` - canvas element that will be used to place the pixelated version of the image
- `image` - image HTMLElement to pixelate
- `scaleFactor` - Number between 0 and 100, lower is more pixelated.## License
MIT (see LICENSE file)