riccardoperra / codeimage

A tool to beautify your code screenshots. Built with SolidJS and Fastify.
https://codeimage.dev
MIT License
1.33k stars 72 forks source link

🚀 - Scale when copy to clipboard #509

Closed goncy closed 1 year ago

goncy commented 1 year ago

Which @codeimage/* package(s) are relevant/releated to the feature request?

codeimage

Description

When exporting, you have the ability to scale before saving. But when you copy to the clipboard you only get 1x images that are low-res for slides. Can the resolution of the copied one be increased/configured?

A small hack I found is just override the devicePixelRatio so the image upscales when copied to clipboard:

image

Which works because of this

riccardoperra commented 1 year ago

Hi @goncy, this is something I would like to add with priority, and with the ui kit update it's something that may be achieved easily. I was thinking to refactor all of these buttons with a ButtonGroup, and the option to customize the export configuration for each case.

What do you think about it? (screenshots is just an example).

The button option could be available for "Copy to clipboard", "Open" and "Export" action. The configuration may also be shared and persisted locally in order to remember the settings.

Anyway, I can release this feature with the end of April deploy which will contains also the Preset and the new UI update

image

in case you can see the preview here, but options are not working at the moment https://codeimage-mcs993eup-riccardoperra.vercel.app/

goncy commented 1 year ago

SGTM 🤝

riccardoperra commented 1 year ago

I haven't forgotten about this but I had so many things to do 😫 This feature should be almost done (just a working preview https://codeimage-31mbaxp2m-riccardoperra.vercel.app).

Both copy-to-clipboard and Open actions will use options from the new export settings button, which will be also persisted locally in order to not lose that settings with refresh

I also added a new scale (6x) that should be enough for most of cases..unless you need images with 10_000x8000 resolution 😅

image

I think I can finish the last few things this week and deploy all the new features in production https://github.com/riccardoperra/codeimage/pull/527

riccardoperra commented 1 year ago

Done and to be deployed in 1.4.0

riccardoperra commented 1 year ago

Live with 1.4.0