-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support mix-blend-mode compositing in screenshots. #1074
Conversation
As an explicit use case, we have a project where a hyperspectral image (fluorescence microscopy) is shown with one channel per layer. We let the users adjust the color and scaling of each channel in a separate layer and composite them via the |
0d50779
to
e6f2e1d
Compare
There are limitations to the current screenshot function. If layers are composited with mix-blend-mode, svg filters, or some other options, these are not applied. mix-blend-mode support is added here; other limitations remain.
e6f2e1d
to
9bbf038
Compare
In some environments, this seems to resolve transient test failures.
Doing the review now |
context.globalAlpha = opacity; | ||
if (mixBlendMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be not possible to just have the user pass any one type of globalCompositeOperation (source in/out, over etc?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, any of the globalCompositeOperation values are supported. They are called mix-blend-mode in css and globalCompositeOperation in canvas.
@@ -62,6 +62,6 @@ describe('blog-lines example', function () { | |||
// this permits a large delta to pass on CI. It visually is rendered | |||
// correctly, though with seemingly different aliasing choices by the | |||
// renderer | |||
imageTest.imageTest('exampleBlogLines10k', '#map', 0.04, done, null, 1000, 2, '.geojs-map.ready'); | |||
imageTest.imageTest('exampleBlogLines10k', '#map', 0.04, done, null, 5000, 2, '.geojs-map.ready'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this increase to 5000?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis was timing out on this. I don't know why, but increasing it allowed the tests to pass. It is like they are using a different mesa library than before that is slower, but that is just speculation.
There are limitations to the current screenshot function. If layers are composited with mix-blend-mode, svg filters, or some other options, these are not applied. mix-blend-mode support is added here; other limitations remain.