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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! 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..  

1 ACCEPTED SOLUTION

Accepted Solutions

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

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.

 

Top Tags