It is currently Sat Jul 06, 2024 12:18 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Rotation of a 2D png image - SOLVED
PostPosted: Fri Jun 24, 2022 11:44 pm  (#1) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 19
Location: Melbourne, Australia
I am using a program, Naalaa 7, to create some simple games. What N7 lacks is the ability to rotate an image. It can 'scan' the sheet and display each image in turn, thus giving the illusion of rotation... but no command to rotate... *sigh*

The sprite sheet that I created (60 images) was created using Gimp and using the basic Shift+R to rotate each image by 6 degrees. This rotated far too quickly and I fear that I do not have the patience to create 180+ images by hand.

I have been using Gimp for a long time but I have never tried my hand at writing scripts. I would appreciate a step-by-step description (or document/video) on how to create the appropriate script. I do not need anyone to write it for me... I need to learn and understand the procedure... lol

Any advice would be greatly appreciated.

Regards

J.


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: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 12:51 am  (#2) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
Hello Johnno56! I recommend you as a coder myself to learn Python, in this case GIMP python. The reason is in my opinion and others, that is easier than Scheme. The only videos tutorial I know around the web that are good for new user that want to learn from the basic are from "Jackson Bates". Be patient and pay attention to the videos and you will writing your first python script.
One thing I can mention, my experienced mostly came from asking around and using common sense. There are a few coders here with a lot of experience, don't hesitate to ask question. Good luck!

Here is the link to the video tutorial:

First part in an 8 part series
https://www.youtube.com/watch?v=cPQRxZo9BJE
Second part in an 8 part series
https://www.youtube.com/watch?v=nvDcaIp9RkQ
Third part in an 8 part series
https://www.youtube.com/watch?v=2RnrIX4h2LM
Fourth part in an 8 part series
https://www.youtube.com/watch?v=nmb-0KcgXzI
Fifth part in an 8 part series
https://www.youtube.com/watch?v=uSt80abcmJs
sixth part in an 8 part series
https://www.youtube.com/watch?v=5Ld8Todog5s
Seventh part in an 8 part series
https://www.youtube.com/watch?v=X0_a6U6PkCA
Eight part in an 8 part series
https://www.youtube.com/watch?v=oNn9D_8d4zQ

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 1:38 am  (#3) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
Yes, those Jackson Bates videos are super to start with.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 2:17 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 19
Location: Melbourne, Australia
Thanks, guys.

I have downloaded all the videos... Now.. Where did a keep my popcorn?


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 2:55 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: May 24, 2021
Posts: 793
Location: SEA - South East Asia
johnno56 wrote:
I am using a program, Naalaa 7, to create some simple games. What N7 lacks is the ability to rotate an image. It can 'scan' the sheet and display each image in turn, thus giving the illusion of rotation... but no command to rotate... *sigh*

The sprite sheet that I created (60 images) was created using Gimp and using the basic Shift+R to rotate each image by 6 degrees. This rotated far too quickly and I fear that I do not have the patience to create 180+ images by hand.

Regards

J.


Learning Python is nice, but if you wish to do your animation now, G'MIC can do it in less than 5 minutes
in GIMP menu "Filters >> G'MIC" a window opens, go to "Sequences >> 3D Image Object [Animated]"

Attachment:
Screenshot_2022-06-25_15-35-09.png
Screenshot_2022-06-25_15-35-09.png [ 200.21 KiB | Viewed 869 times ]


You will see that the maximum number of frame is 100, but once you rendered, select your last layer and re-do G'MIC for the remaining 80 frames
Above you can see some basic parameters, you can even chose a folder where to put each frame if you "tick" the "output as files"

below some "Starting and Ending parameters" (all in between will be frames) at the bottom you can chose your output if you click on "Output Mode" (for this exercise I did just let everything as default)

Attachment:
Screenshot_2022-06-25_15-36-19.png
Screenshot_2022-06-25_15-36-19.png [ 214.38 KiB | Viewed 869 times ]


Below the xcf file zipped if you wish to see the result
once open with GIMP, go to "Filters >> Animation >> Playback..." at the bottom left it's written "Cumulative Layer (combine), click on it and select "One frame per layer (replace)" then beside select "x1, 25 fps", then on the top left you can click on the start animation ;)

Attachment:
Untitled.xcf.7z [3.45 MiB]
Downloaded 16 times

_________________
Patrice


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 3:24 am  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
Try my "ofn-rotate-layer" script, perhaps?

_________________
Image


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 4:27 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 19
Location: Melbourne, Australia
ofnuts,

Thank you for the script. Just for giggles, I set it to rotate my image, by 1 degree in 359 steps. It definitely produced 360 layers of rotated images and it was quick! However, the giggling will quickly stop, if I actually spent a huge amount of time adding all those images to a sprite sheet... lol

I think 360 images may be a little to ambitious on my part... lol I am definitely hanging on on to this scrip! Using your script to create all the images and putting it in concert with a script that could create a "sheet" from those images... That would be so cool....

Thank you for the script!!

J


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 5:14 am  (#8) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2439
Quote:
...snip...with a script that could create a "sheet" from those images...


What format is your sprite sheet ? number of rows x number of columns.

Traditionally you use the align tool to spread the layers, but it is a pain to use.

Ofnuts has a script for importing tiles as rows and columns and there is a montage filter in the gmic plugin that might work. (although I have never tried it with 360 layers ;) ) Ahh...too many images error.

_________________
Image


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 5:45 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 19
Location: Melbourne, Australia
Rich2005,

I located a plug-in "create_spritesheet.pv" that created a sheet from the images made by Ofnuts script. So much quicker than doing it all "by hand"... Now that the sheet is created, it is a simple enough matter, to add the sheet to my game...

Attachment:
create_spritesheet.zip [1.55 KiB]
Downloaded 20 times


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 9:50 am  (#10) 
Offline
Global Moderator
User avatar

Joined: Oct 06, 2010
Posts: 4050
So now we can say it's solved? I'm glad you found such quick solutions, many thanks to our coding crew (Ofnuts) and Information Administrator, Rich2005!

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


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 1:39 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4756
johnno56 wrote:
ofnuts,

Thank you for the script. Just for giggles, I set it to rotate my image, by 1 degree in 359 steps. It definitely produced 360 layers of rotated images and it was quick! However, the giggling will quickly stop, if I actually spent a huge amount of time adding all those images to a sprite sheet... lol

I think 360 images may be a little to ambitious on my part... lol I am definitely hanging on on to this scrip! Using your script to create all the images and putting it in concert with a script that could create a "sheet" from those images... That would be so cool....

Thank you for the script!!

J


See my "ofn-layer-tiles" script (same place) to make a sprite sheet from these.

_________________
Image


Top
 Post subject: Re: Rotation of a 2D png image
PostPosted: Sat Jun 25, 2022 11:31 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Feb 17, 2011
Posts: 19
Location: Melbourne, Australia
Yep! Pretty much resolved. Many thanks for the assist. Much appreciated.


Top
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Rotation Problem: Empty Frame rotates, not image

4

No new posts Attachment(s) How to add new view rotation options?

13

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



* Login  



Powered by phpBB3 © phpBB Group