Skip to content
forked from rogeriopvl/8bit

🎮 Transform images into pixelated artwork

License

Notifications You must be signed in to change notification settings

andrewhayter/8bit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

8Bit | CI status

8Bit is a javascript module that converts an image into a pixelated version using canvas.

You can find a demo here.

Install

NPM

npm install 8bit

Bower

bower install 8bit

Direct file link

<script type="text/javascript" src="https://cdn.rawgit.com/rogeriopvl/8bit/master/8bit.js"></script>

Usage

var eightBit = require('8bit'); // only needed for NPM installs

var 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)

About

🎮 Transform images into pixelated artwork

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.3%
  • HTML 15.7%