cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Rotating bitmap images without resizing?

CS_10222121
5-Regular Member

Rotating bitmap images without resizing?

Hi all:

 

i have a need to be able to rotate a greyscale 8 bit image by discrete angles, e.g. 10 deg, 13 deg, 22 deg, etc..  I have used the built-in rotate command and this does work, but ends up resizing the bitmap and translating the image.  My solution thus far has been to find the center row and columns of the profile that has been rotated and translated, use the submatrix command to extract the array i want from the rotated/translated image, and then resave the bitmap.  this approach works, but was wondering if there was a more efficient/clever method to avoid the rescaling/translation.  I have attached a sample bitmap that i would like to be able to rotate and the same image I have rotated 18.86 degrees clockwise using the approach described above.  Thanks..  

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:CS_10222121)

I don't think that there is another way as the one you described.

But I would suggest turning the whole procedure into a utility function.

Here is one suggestion. I called it "Rotate" with a capital "R" and implemented it that way that the angle is given in radiant to be consistent with all other functions using an angle.

Werner_E_0-1665600402461.png

Rotate.gif

Remark: Unfortunately Mathcads old Animation modul does not support a big color-depth 😞
The slight jerking that can be observed is due to the fact that the centering of the image has to be realized with integer pixel values.

 

View solution in original post

1 REPLY 1
Werner_E
25-Diamond I
(To:CS_10222121)

I don't think that there is another way as the one you described.

But I would suggest turning the whole procedure into a utility function.

Here is one suggestion. I called it "Rotate" with a capital "R" and implemented it that way that the angle is given in radiant to be consistent with all other functions using an angle.

Werner_E_0-1665600402461.png

Rotate.gif

Remark: Unfortunately Mathcads old Animation modul does not support a big color-depth 😞
The slight jerking that can be observed is due to the fact that the centering of the image has to be realized with integer pixel values.

 

Announcements

Top Tags