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

Add ability to save screenshot #240

Merged
merged 2 commits into from
Oct 28, 2024
Merged

Add ability to save screenshot #240

merged 2 commits into from
Oct 28, 2024

Conversation

slimbuck
Copy link
Member

Fixes: #238

This PR:

  • adds a menu option "Save Screenshot" which will download a PNG version of the viewport.
  • use lodpng for compression since inbuilt browser compression can destroy images with alpha
  • add automatic translations for the other languages:
    • french version is confirmed
    • if you have a chance, please check the German @simonbethke
    • anyone else for the rest :)

Since the backbuffer is generated with premultiplied alpha, we must apply a background color before compression.

In future we should consider adding more screenshot options:

  • save without background (i.e. semitrans) or specify a background color
  • optionally remove the debug visuals (grid, overlay, bounding box) so user doesn't have to do this manually
  • support video output of the currently loaded camera path

@slimbuck slimbuck added the enhancement New feature label Oct 28, 2024
@slimbuck slimbuck requested a review from a team October 28, 2024 11:23
@slimbuck slimbuck self-assigned this Oct 28, 2024
@slimbuck slimbuck merged commit d786742 into playcanvas:main Oct 28, 2024
2 checks passed
@slimbuck slimbuck deleted the png-dev branch October 28, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there a way we could render an image at a certain point view?
2 participants