Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Layer Mask #222

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Introduce Layer Mask #222

wants to merge 2 commits into from

Conversation

tyt2y3
Copy link

@tyt2y3 tyt2y3 commented Aug 15, 2017

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');
});

Image was undefined in browser context due to coffeescript declared the Image variable in the first place
An image can be used as a transparency map (white is opaque),
similar to Layer Mask in many photo editors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant