naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.06k stars 326 forks source link

[FEATURE]: Save Brew to Image #2278

Open G-Ambatte opened 2 years ago

G-Ambatte commented 2 years ago

The Region Capture feature of Chrome (Desktop v104 and up) allows a MediaStream to be cropped to a target element. It should be possible to use this to capture the browser's rendered output to either the clipboard (blob) or to a file (PNG).

This article has details about the feature.


This paragraph mentions a potential future Element-level Capture API, which seems like it would be exactly what is needed for this functionality.

5e-Cleric commented 2 years ago

Genuine doubt, what would be the difference between this and exporting a pdf and transforming that into a jpeg or png?

And between those two and Window's Snipping tool?

5e-Cleric commented 1 year ago

Answering myself from the future: absolutely no difference.

G-Ambatte commented 1 year ago

what would be the difference between this and exporting a pdf and transforming that into a jpeg or png?

User convenience: ideally a one click process resulting in a high resolution image of the full content.

And between those two and Window's Snipping tool?

Snipping Tool can result in lower resolution images, and while it is less complex than generating a PDF and converting that to an image, it is still a more complex process than direct image generation.

dbolack-ab commented 7 months ago

I have a working draft for this issue not based on the chrome region grabbing but it has a few issues likely relating to CORS that I have not yet worked out, thus DRAFT. https://github.com/naturalcrit/homebrewery/pull/3219

5e-Cleric commented 7 months ago

@dbolack-ab i believe this issue refers to making the ENTIRE BREW to an image, not just 1 page.

Gazook89 commented 7 months ago

@dbolack-ab i believe this issue refers to making the ENTIRE BREW to an image, not just 1 page.

you would still do it page by page (capturing the page element).

dbolack-ab commented 7 months ago

@dbolack-ab i believe this issue refers to making the ENTIRE BREW to an image, not just 1 page.

you would still do it page by page (capturing the page element).

Why would you do that? To make a CBR?