Gimp-Forum.net
Rotate Blue image every 5 degree - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Rotate Blue image every 5 degree (/Thread-Rotate-Blue-image-every-5-degree)

Pages: 1 2 3 4


Rotate Blue image every 5 degree - AmazingGimp - 12-17-2019

I have one of these image below here.
I would like to select the blue area, and rotate it every 30 degree. For every rotate, i would like it to be a separate layer. Is there any script to do this?

[Image: a2nxYQ.jpg]


RE: Rotate Blue image every 5 degree - Ofnuts - 12-17-2019

Since your image is circular, you can just as well rotate the whole layer (always rotate from initial position, accumulate rotations would add blurriness) Some script fot this, including my own ofn-rotate-layer.

However, given the simplicity of the image it is much simper and clean to recreate it, with some scripts of mine:
  • Generate a dial with 12 marks , 30 degrees apart going from a radius of 75 to a radius of 95 (ofn-dial-marks)
  • Explode each dial mark to its own path (ofn-path-edit/Break path apart)
  • Fill each of these path with blue, on its own transparent layer (ofn-stroke-fill-path)
  • Create a circular path with a 85px radius (ofn-path-to-shape)
  • Add a transparent layer, Edit>Stroke path with a 20px line (not a script of mine Angel )
  • Make that new layer invisible, copy/merge it to the other layers (ofn-interleave-layers)

The GIF:

[attachment=3633]

The WebP (better format, click on attachment icon it to see animation, and see how clean/smooth it is)

[attachment=3634]

The XCF (before the ofn-interleave-layers step, which generates a new image)

[attachment=3635]


My general scripts (ofn-rotate-layer, ofn-interleave-layers) are here.

My path-related scripts (all others) are here.



RE: Rotate Blue image every 5 degree - rich2005 - 12-18-2019

(12-17-2019, 09:38 PM)AmazingGimp Wrote: I have one of these image below here.
I would like to select the blue area, and rotate it every 30 degree. For every rotate, i would like it to be a separate layer. Is there any script to do this?

[Image: a2nxYQ.jpg]

5⁰ or 30⁰ ? Let you sort that out Wink

An alternative nearly in line with your request, you need to make a new layer with the tick. 

For a series of rotated layers, an old script-fu script-fu-copy-rotate-nLayer.scm from the defunct plugin-registry site:
Select your 'tick' apply the script (bottom of select menu)   screenshot https://i.imgur.com/bZjPa6t.jpg  gives this: https://i.imgur.com/GaEIaP6.jpg
As an animated gif in combine mode

[Image: 50Pb8wc.gif]

For a single tick to rotate, combine the background with the layers Using another old script sg-combine-bg.scm as: https://i.imgur.com/tzYYHR6.jpg  and as an animated gif in replace mode:

[Image: APDaaKH.gif]

Both those scripts attached. Unzip, put in your Gimp profile scripts folder 
C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\scripts


RE: Rotate Blue image every 5 degree - Krikor - 12-18-2019

In the example given in the first post, the blue area extends without interleaving. So I figured the desired would be something like:


RE: Rotate Blue image every 5 degree - Ofnuts - 12-18-2019

For this, just make a circle path and use my ofn-path-animation, then merge as above on the grey ring:

[attachment=3638]

Click for animation on the Webp (cleaner and 1/5th the file size...)

[attachment=3639]

It is also easy to do more steps (360) and have a round end:

[attachment=3640]



RE: Rotate Blue image every 5 degree - Ofnuts - 12-18-2019

There is also https://www.gimp-forum.net/Thread-ofn-path-marquee


RE: Rotate Blue image every 5 degree - AmazingGimp - 12-18-2019

Oh my goodness, you guys are great!
I am going to try the method ofnuts and rich2005 have.
My next question is, i would like to have 360 images at different position save as Circle_000 up to Circle360.png.

The reason for that is because the screen design software that i have only supports import of png images, and the screen will communicate with a controller which tells the screen which images to utilize.


RE: Rotate Blue image every 5 degree - Ofnuts - 12-19-2019

Try ofn-export-layers (in the repositories mentioned above) Smile


RE: Rotate Blue image every 5 degree - AmazingGimp - 12-19-2019

Hi OfNuts,

Looks like I am pretty bad at following directions for hours and i'm only stuck at step 3 Sad, plus this is my comeback in graphic after decades.

I am at this step "Create a circular path with a 85px radius (ofn-path-to-shape)"
I right click on one of the 12 path, shapes --> onsegement/on strokes --> circle (Radius,consecutive), it drew multiple circles instead.
Could you help me create a more detail guide, or small video that i can see how you utilize your scripts? I really would like to learn them, at the same time, have tasks at hand that needs completion.


RE: Rotate Blue image every 5 degree - Ofnuts - 12-19-2019

To create a circular path with a 85px radius, you

1. Create a new path, with a single segment that is 85px long and starts at the center of the circle (or is 170px long and is a diameter of the future circle)
2. In the Path list, right-click on it and use Shapes>On segments>Circles