0.1.5 • Published 6 years ago

translucify v0.1.5

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Translucify

Makes an image's background pixels transparent. Replaces img with canvas.

Installation and Usage

npm install --save translucify

translucify(selectorResult, tolerance)

Use the flood-fill method for making the background transparent.

tolerance is a value from 0 to 1 that determines which pixels are part of same group of pixels to be flooded with transparency. Default value: 0.05

Example: drop-in usage

<html>
    <head>
        <script src="//path/to/libs/translucify.js"></script>
        ...
    </head>
    <body>
        ...
        <img src="cheese1.jpg"/>
        ...
    </body>
</html>
window.translucify($('img'));

Example: Browserify usage

var translucify = require('translucify');

...

translucify(document.querySelectorAll('img'));

Creating the reference image for testing

npm start

Running the test

npm install
grunt
0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago