Closed wooly closed 10 years ago
Looks good, two comments. Also, can you add a spec for this method?
I've added a few specs, and changed the interface so we have apply_mask
and apply_mask!
methods. Unfortunately, my attempt to hack together the masked.png reference image didn't work, so the two specs that really matter won't work. Would you be able to take a look, @wvanbergen?
I'm on vacation; it'll take a while before I can look at this.
Sent from my iPhone
On Jul 8, 2014, at 16:50, Steve Bell notifications@github.com wrote:
I've added a few specs, and changed the interface so we have apply_mask and apply_mask! methods. Unfortunately, my attempt to hack together the masked.png reference image didn't work, so the two specs that really matter won't work. Would you be able to take a look, @wvanbergen?
— Reply to this email directly or view it on GitHub.
Closing this stale branch; you can already perform an operation like this using the well tested compose
method, and I'd like to keep the scope and complexity of this library relatively small.
I had a need for an operator like this when I wanted to apply a circular layer mask to an image. I thought it might be useful for others too!
Starting with an image, you create a canvas of the same size with a white background. Then you 'colour in' bits of the new canvas black. Use
mask.apply_as_image(image)
to modify the mask replacing all black pixels with their respective image pixels.