It is currently Tue Jul 23, 2024 7:16 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 4:50 pm  (#1) 
Offline
GimpChat Member

Joined: Dec 30, 2010
Posts: 17
I need to rotate an entire image with the whole image remaining and no change in the image, when the rotate tool is used to rotate an image with no interpolation the image is modified a little bit. I have a mathmap script that does some of what I need but doesn't keep the entire image in its original state. this is it:

filter slide (image in)

if y>=x then


in(xy:[x,y-x-1])


end


end


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 5:35 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Did you try Geometry rotate in MathMap? The radian of 45 degrees would = .785 (in case you didn't understand the angle rotation in radians)

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Last edited by mahvin on Wed Jan 26, 2011 8:28 pm, edited 1 time in total.

Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 5:42 pm  (#3) 
Offline
GimpChat Member

Joined: Dec 30, 2010
Posts: 17
I have just tried it and i'm not sure how to rotate exactly 45 degrees with keeping the original image


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 5:53 pm  (#4) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
Maybe I am not understanding your request: Do you want the original image to not lose quality? Or to leave an unaltered image at its current state while rotating a copy?

_________________
"In order to attain the impossible, one must attempt the absurd."
~ Miguel de Cervantes


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 5:56 pm  (#5) 
Offline
GimpChat Member

Joined: Dec 30, 2010
Posts: 17
I want to rotate an image 45 degrees without the image being altered at all, apart from the whole image being rotated 45 degrees. I would use the rotate tool but it alters the image a bit.


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 6:58 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4757
interbloke wrote:
I want to rotate an image 45 degrees without the image being altered at all, apart from the whole image being rotated 45 degrees. I would use the rotate tool but it alters the image a bit.

What interpolation method are you using with the rotate tool? Rotating the image 45° will degrade it since there is not a one-to-one pixel correspondance between the two, but some interpolation methods are better than others.

_________________
Image


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 7:15 pm  (#7) 
Offline
GimpChat Member

Joined: Dec 30, 2010
Posts: 17
ofnuts wrote:
interbloke wrote:
I want to rotate an image 45 degrees without the image being altered at all, apart from the whole image being rotated 45 degrees. I would use the rotate tool but it alters the image a bit.

What interpolation method are you using with the rotate tool? Rotating the image 45° will degrade it since there is not a one-to-one pixel correspondance between the two, but some interpolation methods are better than others.


I was using no interpolation and the lines in the image below became 3 pixels wide at random times (so it altered the image)

Image


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Wed Jan 26, 2011 7:41 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12535
Sounds like you are trying to keep the bitmap as an object container and then rotating that container. The best way to do this based on my understanding of what you want is to use a vector editor like Inkscape. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 1:36 am  (#9) 
Offline
GimpChat Member

Joined: Dec 30, 2010
Posts: 17
the mathmap script I provided above I think kept the original image it just cut part of it out, can somebody change the script to where it doesn't cut any part out?


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 2:24 am  (#10) 
Offline
GimpChat Member

Joined: Dec 30, 2010
Posts: 17
lylejk wrote:
Sounds like you are trying to keep the bitmap as an object container and then rotating that container. The best way to do this based on my understanding of what you want is to use a vector editor like Inkscape. :)


ok I have the correct image now on the screen in inkscape what do I do now, like how do I save it?


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 2:38 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12535
File>Export and choose filename.png. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 12:45 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
If you take your original image, go to Image > Canvas Size > 200% and click "Center", and then ok. Then do a "layer to image size". Now use your mathmap to rotate it. Now you have the image rotated, without cutting anything away.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 12:52 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
I just tried your script and it skews the image instead of rotating it, so my idea won't work. Let me play some more and see what I can come up with.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 1:03 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14725
Location: USA
lylejk wrote:
File>Export and choose filename.png. :)


Remember to click the Export button on the dialog after you select a location and name to save it as.

Image

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Thu Jan 27, 2011 1:06 pm  (#15) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
If you enlarge the canvas, as I said above, and then do Filters > Map > Map to Object, set "Plane", transparent object on, and then on the orientation tab set Rotation x=45. See if this does it well enough.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Fri Jan 28, 2011 12:57 pm  (#16) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
The bottom line is, you will change the image! you have to, as you are converting from a square pixel grid to a 45deg rotated diamond grid.

Each "pixel" that used to be 1x1 is now spread across a 1.41 by 1.41 px diamond, so will have to either be interpolated (blurred) or nearest neighbor selected (interpolation none).

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Fri Jan 28, 2011 1:51 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2010
Posts: 2253
Location: Retired Moderator Slowly Returning to the Living.
The image will definitely be changed, as there is no way to rotate 45 degrees and not have a change. The trick is to find what will show the change the least.

_________________
Artists aren't crazy! We're eccentric! ~G.M. Ross

Image

My Sigs = My Photos
Check out my work at http://www.flickr.com/photos/photomastergreg.


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Fri Jan 28, 2011 2:30 pm  (#18) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
the only rotation that doesn't degrade bitmap images is of 90° ,and multiplies as 180° or 270° ,because are from a square grid to a similar square grid

anyway if the image is at high resolution a single rotation should not cause too visible degradation.

I suppose you get better result with mathmap because of the mathmap supersampling option, not sure if gimp may use something similar when rotating

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Fri Jan 28, 2011 2:42 pm  (#19) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
BTW
you are right should be really easy modify the MM script to avoid cropping but i don't know the MM language, you may try to ask on the flickr and google MM group (no much traffic there but is worth to try, for who know the syntax should be a quick thing , just multiply W and H of the new image of 1.42)

hy thinking better you may do: before run MM do Image/canvas size and increase of x1.5 (easily then 1.42)then "Layer to image size"

and then you may use MM without risk to crop the layer

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: rotating image 45 degrees without modifying image
PostPosted: Fri Jan 28, 2011 3:17 pm  (#20) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 697
OK - Looking at your example,I think you want this:
filter slide (image in)
in(xy:[x,(y-x-1+Y)%Y])
end

Attachment:
shear.png
shear.png [ 16.32 KiB | Viewed 2887 times ]


-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Retexture an image with another image as "Image Pattern" Plug-in

4

No new posts Show image on web browser to fill 100% width AND image map

2

No new posts Attachment(s) image name

2

No new posts Attachment(s) Image to bit map file

7

No new posts Attachment(s) Image Logo

3



* Login  



Powered by phpBB3 © phpBB Group