GPWiki.org
GPWiki.org
It is currently Tue Jun 18, 2013 5:59 am

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Mon Sep 08, 2008 1:38 pm 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3745
Location: South Africa
I want to take an initial image which is facing North, and rotate it by 5°, save it as image0.png, then rotate the original by 10°, save it again as image1.png. Any way to automate this process? The most advanced graphic package I have atm is Corel PhotoPaint. Otherwise some kind of utility on the net?

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 1:48 pm 
Digerati

Joined: Fri Sep 24, 2004 3:15 am
Posts: 1791
Location: No longer near Boston, MA
I can't image what you'd need it for, but there's probably scripts out there. For a game, why not just rotate the image yourself?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 2:37 pm 
Bibliotherapist
User avatar

Joined: Wed Dec 21, 2005 6:23 pm
Posts: 6210
Location: Manchester, UK
you could investigate imagemagick, which has a load of options for command line image processing.

I go with SP though... why would you want to do this? Are you unable(through project requirements) to use or create the functions to do this on the fly using hardware accelerated graphics?

_________________
God must love stupid people, he made so many.
theraje: 'God doesn't love stupid people, they're just easier to make'
http://sharedillusions.blogspot.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 3:41 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2217
Location: England
why not write your own little program to do it?

You know the rotation formula don't you?

Well write a program do that to every pixel of the target picture, and use say bilinear interpolation of the source image to work out what colour to paint with. :)

Without that interpolation, jaggies are going to be your biggest problem.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 5:06 pm 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11199
Location: Abingdon, MD
Sadistic Penguin wrote:
For a game, why not just rotate the image yourself?

Agreed.

_________________
Bored? Head on over to my blog and see what I'm up to.

Microsoft XNA MVP


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 6:27 pm 
Dexterous Droid

Joined: Fri Aug 19, 2005 10:34 am
Posts: 3650
If you are able to use 3d accelerated hardware, which I assume you can unless you're targeting a very specific device or people who also use those old 20 lb cell phones, it would most more efficient for the game to rotate via hardware. Loading all of those textures is going to end up costing quite a lot of memory, and there will be less chance for batching. Even a 32x32 image, which would normally be like 4 KB in memory (assuming a 32-bit, uncompressed format) would end up 288 KB of memory for 5 degree rotations.

Doing it on-the-fly also allows you to use better filtering and anti-aliasing for the rotation. This is normally lost when saved to a bitmap since it produces results based on the environment around it.

_________________
NetGore - Open source online RPG engine


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 9:49 pm 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3745
Location: South Africa
Ok, reason I can't do that is because I get given an engine for this assignment and it doesn't have that feature for some daft reason.

Imagemagick looks like just the thing I need, but I'll look into it tomorrow |I

Thanks!

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 08, 2008 9:55 pm 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2217
Location: England
I've made a little program to do this for you Igthorn.

Here is the source for it.

I hope that helps.

EDITED: Archive no longer double packed.


Last edited by Jasmine on Tue Sep 09, 2008 7:28 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 10:16 am 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3745
Location: South Africa
Jasmine wrote:
I've made a little program to do this for you Igthorn.

Here is the source for it.

I hope that helps, and sorry for the double packaging.


Woah! Very cool, it works well :) I like the name too :P

Thank you! :D

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 11:56 am 
Corpse Bride
User avatar

Joined: Tue Jul 01, 2008 11:44 pm
Posts: 2217
Location: England
IGTHORN wrote:
Jasmine wrote:
I've made a little program to do this for you Igthorn.

Here is the source for it.

I hope that helps, and sorry for the double packaging.


Woah! Very cool, it works well :) I like the name too :P

Thank you! :D


No problem. I just hope the antialiasing works. :) Last time I did this I got the interpolation back to front. |I It would run a lot quicker without all tht RGB splitting, but it makes for better images :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 09, 2008 12:24 pm 
Dexterous Droid
User avatar

Joined: Wed Aug 18, 2004 7:40 pm
Posts: 3745
Location: South Africa
Jasmine wrote:
IGTHORN wrote:
Jasmine wrote:
I've made a little program to do this for you Igthorn.

Here is the source for it.

I hope that helps, and sorry for the double packaging.


Woah! Very cool, it works well :) I like the name too :P

Thank you! :D


No problem. I just hope the antialiasing works. :) Last time I did this I got the interpolation back to front. |I It would run a lot quicker without all tht RGB splitting, but it makes for better images :)


The AA looks great - although I have no idea how it works hehe.

_________________
Whatever the mind can conceive and believe, it can achieve


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group