Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic cutting image into equal parts
#1
Hello again everyone,

I am back with a question about automating tasks. I have the image below.

     

It is a quarter of a circle, 90 degrees. I want to make a gauge out of it by cutting it into 100 segments of 9 degrees each. Is there an easy way to do this?

Thanks
Reply
#2
Maybe, 100 iterations, 90 deg, more old scripts, I have posted these before but to keep for this topic. (attached, unzip and put in scripts folder)

   

(1) Determine a suitable "wedge" This is so small, it is basically a rectangle.
(2) A new image using that "wedge"
(3) Apply Selection -> script-fu-copy-rotate-nLayer  Center of rotation is bottom - right corner / angle = -0.9 deg / copies = 100

   

(4) Apply Layer -> Multiple Layer Actions -> Layer to Image Size (to fix rotated layers outside canvas)

As an animation:

   


Attached Files
.zip   rotate-n-layers.zip (Size: 3.56 KB / Downloads: 202)
Reply
#3
(05-06-2024, 11:25 AM)rinaldop Wrote: Hello again everyone,

I am back with a question about automating tasks. I have the image below.

 

It is a quarter of a circle, 90 degrees. I want to make a gauge out of it by cutting it into 100 segments of 9 degrees each. Is there an easy way to do this?

Thanks

If you make 10 segments of 9 degrees you will have 90º.
How can you want 100 segments of 9 degrees in a 90º arc?
Wouldn't it be 10 degrees by any chance?

I tried using the Duplicate and rotate a path script, but it doesn't work with decimal places.

I would need to have an angle of 0.9 degrees to have 100 divisions in a 90 degree arc segment.
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#4
(05-06-2024, 01:10 PM)rinaldop Wrote:
(05-06-2024, 01:04 PM)Krikor Wrote:
(05-06-2024, 11:25 AM)rinaldop Wrote: Hello again everyone,

I am back with a question about automating tasks. I have the image below.


It is a quarter of a circle, 90 degrees. I want to make a gauge out of it by cutting it into 100 segments of 9 degrees each. Is there an easy way to do this?

Thanks

If you make 10 segments of 9 degrees you will have 90º.
How can you want 100 segments of 9 degrees in a 90º arc?
Wouldn't it be 10 degrees by any chance?

Ugh, you are correct, I did the math wrong, it should be .9 degrees Wink

It's good to know we understand each other now. :-)

I believe that with the ofn-dial-marks.py plugin you can do this.

     

You can find the plugin at: https://sourceforge.net/projects/gimp-pa...s/scripts/
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#5
(05-06-2024, 12:52 PM)rich2005 Wrote: Maybe, 100 iterations, 90 deg, more old scripts, I have posted these before but to keep for this topic. (attached, unzip and put in scripts folder)
WOW, thank you very much!

I will give it a try Wink

I suppose the same technique can be used to move this minute hand around the dial? 

   
Reply
#6
You can or possibly better is the path rotator script mentioned by Krikor

From the dim-and-distant past Wink https://www.gimp-forum.net/Thread-Making-a-watch-face
Reply
#7
(05-06-2024, 01:21 PM)Krikor Wrote:
(05-06-2024, 01:10 PM)rinaldop Wrote:
(05-06-2024, 01:04 PM)Krikor Wrote: If you make 10 segments of 9 degrees you will have 90º.
How can you want 100 segments of 9 degrees in a 90º arc?
Wouldn't it be 10 degrees by any chance?

Ugh, you are correct, I did the math wrong, it should be .9 degrees Wink

It's good to know we understand each other now. :-)

I believe that with the ofn-dial-marks.py plugin you can do this.

 

You can find the plugin at: https://sourceforge.net/projects/gimp-pa...s/scripts/

Thank you, I will try that!

I will also look at the   the Duplicate and rotate a path script, if I decide not to use decimals. 

(05-06-2024, 02:29 PM)rich2005 Wrote: You can or possibly better is the path rotator script mentioned by Krikor

From the dim-and-distant past Wink https://www.gimp-forum.net/Thread-Making-a-watch-face

Great, thanks again!
Reply
#8
(05-06-2024, 01:21 PM)Krikor Wrote: I believe that with the ofn-dial-marks.py plugin you can do this.

 

You can find the plugin at: https://sourceforge.net/projects/gimp-pa...s/scripts/

Hello again!

I had other projects to do and now that I have time I am ready to try this. What I want to do is basically the same just slightly different. I want to slice a circle into 100 equal parts.

I am using your plugin and it seems to have worked. My x,y coordinates are 0,0. Outer radius 98, inner radius 71. Since I want 100 equal slices I used 100 marks and mark width of 3.6 I used start angle of 0, shape  polygonal, direction clockwise, and one path per mark. That gives me this:

   

Which is exactly what I want! Now comes what I assume is the easy part but what I need help with. How do I export each slice so I get 100 individual frames.

Thanks
Reply
#9
(06-11-2024, 12:47 PM)rinaldop Wrote:
(05-06-2024, 01:21 PM)Krikor Wrote: I believe that with the ofn-dial-marks.py plugin you can do this.

 

You can find the plugin at: https://sourceforge.net/projects/gimp-pa...s/scripts/

Hello again!

I had other projects to do and now that I have time I am ready to try this. What I want to do is basically the same just slightly different. I want to slice a circle into 100 equal parts.

I am using your plugin and it seems to have worked. My x,y coordinates are 0,0. Outer radius 98, inner radius 71. Since I want 100 equal slices I used 100 marks and mark width of 3.6 I used start angle of 0, shape  polygonal, direction clockwise, and one path per mark. That gives me this:



Which is exactly what I want! Now comes what I assume is the easy part but what I need help with. How do I export each slice so I get 100 individual frames.

Thanks

The plugin you used is from Mr Ofnuts.

You could try another Ofnuts plugin, in this case: ofn-extract-objects-layers
You will probably find this plugin in the same location indicated above*.


* Edite: https://sourceforge.net/projects/gimp-to...s/scripts/
                               .....
Samj PortableGimp 2.10.28 - Win-10 /64.
Reply
#10
Some more scripts at the same place
  • ofn-path-edits has a Break path apart function. It takes a path and makes a path from each stroke (each "mark" in your path) (so now you have 100 more paths). But instead you can use ODM to generate one path per mark directly
  • ofn-stroke-fill-paths will fill each of the above paths in a corresponding layer (so you have 100 layers)
   
Reply


Forum Jump: