Hide One Image In Another Using Alpha Channel – image-hide

Category: Image , Javascript | October 24, 2019
AuthorCoxxs
Last UpdateOctober 24, 2019
LicenseMIT
Tags
Views180 views
Hide One Image In Another Using Alpha Channel – image-hide

image-hide is a JavaScript module to hide one image in another using PNG alpha channel.

How to use it:

1. Install and import the image-hide module.

# NPM
$ npm install image-hide --save
const fs = require('fs')
const hide = require('image-hide')

2. Prepare two PNG images with the same size.

let imageA = fs.readFileSync('a.png')
let imageB = fs.readFileSync('b.png')

3. Combine these 2 images together.

fs.writeFileSync('result.png', Buffer.from(hide(imageA, imageB)))

You Might Be Interested In:


Leave a Reply