1.0.2 • Published 5 years ago

alpha-mask v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

README.md

merge source.png with mask.png to alpha.png

install

yarn add alpha-mask

demo

image_1

=>

image

code

import { createWriteStream, pathExistsSync, ensureWriteStream, outputFile } from 'fs-iconv';
import { mergeMaskByFile, generateAsync, outputAsync } from 'alpha-mask';
import FastGlob from '@bluelovers/fast-glob/bluebird';
import * as path from 'path';

mergeMaskByFile(path.join(__dirname, './res/char_002_amiya_2.png'), path.join(__dirname, './res/char_002_amiya_2[alpha].png'))
.then(img => {
	return outputAsync(path.join(__dirname, 'out.png'), img)
})
;

out.png