imageproc icon indicating copy to clipboard operation
imageproc copied to clipboard

Add `rotate_about_center_no_crop` to prevent pixel loss during image rotations

Open Tikitikitikidesuka opened this issue 4 months ago • 11 comments

This PR introduces a new method, rotate_about_center_no_crop, that rotates an image about its center without cropping, ensuring no pixel data is lost in the process. The function calculates the new dimensions to fully accommodate the rotated image and fills any empty space outside the original image boundaries with a user-defined default pixel value.

To support this new method, two auxiliary functions are included:

  1. rotate_about_center_into: Same as rotate_about_center_into except it writes the output to an image passed as a mutable reference. Dimensions of the input image and the output do not have to be the same.
  2. rotate_into: Same as rotate_into except it writes the output to an image passed as a mutable reference. Dimensions of the input image and the output do not have to be the same.

Tikitikitikidesuka avatar Oct 02 '24 11:10 Tikitikitikidesuka