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
(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