Skip to content

semanser/png-pixel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

npm version

Installation

npm install png-pixel --save

Usage

const PNGPixel = require('png-pixel')

PNGPixel.add('input.png', 'output.png', [
    {x: 14, y: 10, color: '#24B3E3'},
    {x: 14, y: 11, color: '#E32437'},
    {x: 2, y: 5, color: 'E4238E', opacity: 128} // opacity is a 0-255
]).then(() => console.log('PNG successfully written'))

Note: Input file need to be already exist before adding pixels.