Gimp-Forum.net
Automatic cutting image into equal parts - 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: Automatic cutting image into equal parts (/Thread-Automatic-cutting-image-into-equal-parts)

Pages: 1 2


Automatic cutting image into equal parts - rinaldop - 05-06-2024

Hello again everyone,

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

 [attachment=11793]

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


RE: Automatic cutting image into equal parts - rich2005 - 05-06-2024

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)

[attachment=11794]

(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

[attachment=11795]

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

As an animation:

[attachment=11796]


RE: Automatic cutting image into equal parts - Krikor - 05-06-2024

(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.


RE: Automatic cutting image into equal parts - Krikor - 05-06-2024

(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.

[attachment=11799] 

You can find the plugin at: https://sourceforge.net/projects/gimp-path-tools/files/scripts/


RE: Automatic cutting image into equal parts - rinaldop - 05-06-2024

(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? 

[attachment=11801]


RE: Automatic cutting image into equal parts - rich2005 - 05-06-2024

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


RE: Automatic cutting image into equal parts - rinaldop - 05-06-2024

(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-path-tools/files/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!


RE: Automatic cutting image into equal parts - rinaldop - 06-11-2024

(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-path-tools/files/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:

[attachment=11982]

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


RE: Automatic cutting image into equal parts - Krikor - 06-11-2024

(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-path-tools/files/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-tools/files/scripts/


RE: Automatic cutting image into equal parts - Ofnuts - 06-11-2024

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)
[attachment=11983]