Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rotate Blue image every 5 degree
#11
Going back a couple of posts

Quote: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.

Another couple of utility scripts that might help:

Depending on method used you might need to resize all the layers to the image size. Rotating a layer will often make larger than the canvas size.  Very tedious for 360 layers. This one Multiple-Layer-Actions.scm can put everything to canvas size.  Find it bottom of the layers menu: https://i.imgur.com/tHzV6NG.jpg

There are one or two scripts for exporting layers to individual images, some more complicated than others. This one sg-save-all-layers.scm can re-name and export to png Find it bottom of the file menu: https://i.imgur.com/6KKsxLZ.jpg

Just a note about layer order, naming starts at the top of the layer stack. If you need reverse order then built into Gimp is Layer -> Stack -> Reverse Layer order Apply that before exporting.

This will not affect you because looks like the final result is not an animated gif but Filters -> Animation -> Optimise is broken in Gimp 2.10.14

[Image: 9rrbYE8.gif]


Attached Files
.zip   save-all-layers.zip (Size: 4.89 KB / Downloads: 315)
Reply
#12
(12-19-2019, 08:02 AM)Ofnuts Wrote: 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

What is the best way of creating the path at center?
- Do i use 50/50 guides?
- based on the canvas size, find mid X,y and somehow move the mouse until the coordinates show the desire xy.
- or is there a function after I draw this 85px straight line, can I say position it to center?

Sorry, for the basic question. 
Happy holidays everyone.
Reply
#13
I create centered guides. You can do it by hand, but personally, since I need this for 80% of the pictures I create, I even have a script for this: ofn-preset-guides, and assigned a shortcut to the relevant entry ("FullMonty")
Reply
#14
(12-20-2019, 12:41 PM)AmazingGimp Wrote: What is the best way of creating the path at center?

I use a script (shape-path), attached. It is old but still works.
Unzip and put it in the Scripts folder of your user profile. Find it at Script-Fu > Shape Paths

There is better one called arakne-path-shape-creator8, but it does not work on my Windows/Gimp.


Attached Files Image(s)
   

.zip   ShapePaths.zip (Size: 4.86 KB / Downloads: 196)
Reply
#15
(12-17-2019, 11:33 PM)Ofnuts Wrote: 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:



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



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




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

My path-related scripts (all others) are here.
When i use the (ofn-path-edit/Break path apart) script, the first layer starts with the 90° layer, then it goes CCW. Is it possible so that the first layer starts at the 0°, and go CW from there?
Reply
#16
(12-23-2019, 04:33 AM)AmazingGimp Wrote: When i use the (ofn-path-edit/Break path apart) script, the first layer starts with the 90° layer, then it goes CCW. Is it possible so that the first layer starts at the 0°, and go CW from there?

Two things you can do:

Use the Rotate Tool. In the Tool Options, set "Transform" to "Path". You can then use the on-screen dialogue to get exactly 90 (or -90) degrees.

You then use ofn-path-edit/Reverse strokes
(Found in the same place as (ofn-path-edit/Break path apart)
Reply
#17
(12-17-2019, 11:33 PM)Ofnuts Wrote: [*]Make that new layer "RING" invisible, copy/merge it to the other layers (ofn-interleave-layers)

[*]When i open Ofnuts xcf file, this last step where it says "Make that new layer invisible". 
I made ring layer invisible, then ran the 'ofn-interleave-layers'. It created a new image file. That exported all the visible layers to the other page, except the grey ring layer that has the 20px circle. 
I tried exporting it to gif, all i get is the tick marker animating without the grey background.

Then, I tried making the RING layer visible, and ran the 'ofn-interleave-layers', I get the tick marker animating without the grey background, and the last frame is the grey background by itself.

I think i am missing is the copy/merge to the other layers. I am not sure what he meant by that. Does he meant I have to duplicate the grey ring layers 12 times (since I have 12 blue markets), and then merge each of these marker with the grey ring?

Thanks for patience everyone.
Reply
#18
(12-23-2019, 04:33 AM)AmazingGimp Wrote: When i use the (ofn-path-edit/Break path apart) script, the first layer starts with the 90° layer, then it goes CCW. Is it possible so that the first layer starts at the 0°, and go CW from there?

90° to what Smile I assume that you overlooked the last parameter of the dial-marks script and left it to 0. Maybe you wanted 90° or 270°.

However, AFAIK, dial-marks create the marks clockwise. Which means that when you breaks the path apart, the first mark is at the bottom, because the animation plays bottom-up... and the path stroking/filling will also create the layers in the same order, with the layer of the first mark at the bottom. In my examples above, I didn't change the direction, it was naturally clockwise...

If you want to change the rotation direction and if the path is centered, just flip the image (Image>Transform>Flip, either direction will do). You can also use Image>Transform>Rotate to "fix" the origin if you don't want to re-run dial-marks. These two transforms should of course happen before you split the path to pieces.
Reply
#19
(12-23-2019, 05:04 AM)Blighty Wrote:
(12-23-2019, 04:33 AM)AmazingGimp Wrote: When i use the (ofn-path-edit/Break path apart) script, the first layer starts with the 90° layer, then it goes CCW. Is it possible so that the first layer starts at the 0°, and go CW from there?

Two things you can do:

Use the Rotate Tool. In the Tool Options, set "Transform" to "Path". You can then use the on-screen dialogue to get exactly 90 (or -90) degrees.

You then use ofn-path-edit/Reverse strokes
(Found in the same place as (ofn-path-edit/Break path apart)

 "reverse strokes" changes the direction of individual strokes, it doesn't reorder them in the path.
Reply
#20
(12-23-2019, 05:54 AM)AmazingGimp Wrote:
(12-17-2019, 11:33 PM)Ofnuts Wrote:
  • Make that new layer "RING" invisible, copy/merge it to the other layers (ofn-interleave-layers)

When i open Ofnuts xcf file, this last step where it says "Make that new layer invisible". 
I made ring layer invisible, then ran the 'ofn-interleave-layers'. It created a new image file. That exported all the visible layers to the other page, except the grey ring layer that has the 20px circle. 
I tried exporting it to gif, all i get is the tick marker animating without the grey background.

Then, I tried making the RING layer visible, and ran the 'ofn-interleave-layers', I get the tick marker animating without the grey background, and the last frame is the grey background by itself.

I think i am missing is the copy/merge to the other layers. I am not sure what he meant by that. Does he meant I have to duplicate the grey ring layers 12 times (since I have 12 blue markets), and then merge each of these marker with the grey ring?

Thanks for patience everyone.

In single-layer modes, Interleave-layer takes a layer (from anywhere, the current image or another), and copy/merges it with the visible layers of the current image.
  • If the layer is from another image (not your case) it can be visible or not in its carrier image
  • If the layer is from the same image, it must be not visible, otherwise in the output there will be a frame with that layer merged over itself  (which is what you found out when you made the ring layer visible).
It you don't get the ring layer in the output, it is possible that you didn't specify the ring layer as the layer to merge (Layer: parameter in the dialog). Otherwise please attach your XCF here.
Reply


Forum Jump: