CamanJS icon indicating copy to clipboard operation
CamanJS copied to clipboard

Introduce Layer Mask

Open tyt2y3 opened this issue 8 years ago • 0 comments

In some personal projects I encounter the use case when I have to use layer mask to implement some Photoshop filters Naively, we can embed the layer mask into the alpha channel and save the image as a png. This loses the compression ability of jpeg but can still work. But, in order to mimic the Photoshop adjustment layer, then there is no workaround other than layer mask image So, for example, one can do the following to selectively brighten a specific portion of an image

this.newLayer(function () {
    this.copyParent();
    this.filter.exposure(10);
    this.filter.contrast(15);
    this.layerMask('layermask.jpg');
});

tyt2y3 avatar Aug 15 '17 04:08 tyt2y3