lospec / pixel-editor

An online canvas based Pixel Art creation tool for Lospec.com
https://Lospec.com/pixel-editor
GNU General Public License v3.0
915 stars 74 forks source link

FEATURE: Rotate selection #39

Open unsettledgames opened 3 years ago

unsettledgames commented 2 years ago

(credit Jaman on Discord)

1) Draw the selection to a headless canvas (rotated) 2) Get the image data: headlessCtx.getImageData(...selectionRect) 3) Trim or replace semi-transparent pixels in the image data ( replacing them with a 'similar' color from their palette would be awesome 😄, could be a checkbox option) 4) Draw it