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

Fix download images to match live gl3d plot #4566

Merged
merged 5 commits into from
Mar 10, 2020
Merged

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Feb 10, 2020

Fixes #4378 | Demo

@plotly/plotly_js
cc: @alexcjohnson

@archmoj archmoj added bug something broken status: reviewable labels Feb 10, 2020
var q = 255 / a;

for(var l = 0; l < 3; ++l) { // RGB
pixels[k + l] = Math.min(q * pixels[k + l], 255);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can explain why we need to apply this transform when exporting images?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike openGL, webGL premultipliedAlpha in enabled by default.
To get correct RGB values from the webgl context it was needed to devide RGB values by alpha.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, what would happen if we instead disable premultipliedAlpha on image exports?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question; but that didn't work: demo.

@etpinard etpinard added this to the v1.53.0 milestone Feb 10, 2020
@etpinard
Copy link
Contributor

💃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

difference between live 3-D graph with downloaded PNG
2 participants