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


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

(06-11-2024, 02:42 PM)Ofnuts Wrote: 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)

Thank you both. I guess I need to be more clear when I post, I do not just want the sliver like you posted above but the entire slice as it grows like was shown in a previous reply. How do I save these images as they go  from 1 degree to 360 degrees? I know that the image below is just 90 degrees, that is from my original post. This time I would like all 360 degrees, going from a 1 degree slice to the full circle.
 



[Image: attachment.php?aid=11796]


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

Then you ask ofn-stroke-fill-path to generate the marks on a transparent background, and use the layer name pattern to add a (combine) marker in the layer name.

[attachment=11984]

You just need to rename the bottom layer to set it to (replace). You can also ad a general background to that layer if necessary

[attachment=11985]

[attachment=11986]



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

(06-11-2024, 05:02 PM)Ofnuts Wrote: Then you ask ofn-stroke-fill-path to generate the marks on a transparent background, and use the layer name pattern to add a (combine) marker in the layer name.



You just need to rename the bottom layer to set it to (replace). You can also ad a general background to that layer if necessary

I really wanted to figure out how to do this on my own but after trying for several hours I need more help.

About the ofn-dial-marks.py plugin. I need to know what to use for number of marks and mark width to fill the circle. I used 100 and 3.6 degrees thinking that this would fill a 360 degree circle but the slices continued past 360. I also need to know what to use for generated paths.

In order to get images of the full slice of the circle and not just the pointer I was not sure if I needed to do the steps listed in the post at the end of page 1 AND the steps listed above or just the steps listed above.

Also what does rename the bottom layer to set it to `(replace) do?

I assume that the final step is to export all layers, correct?


Thank you


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

(06-15-2024, 07:27 AM)rinaldop Wrote: About the ofn-dial-marks.py plugin. I need to know what to use for number of marks and mark width to fill the circle. I used 100 and 3.6 degrees thinking that this would fill a 360 degree circle but the slices continued past 360.

The start angle is the center of a mark. The script will indeed cover 360°. Here it is with 10 marks of 36° each:

[attachment=12000]

(06-15-2024, 07:27 AM)rinaldop Wrote: I also need to know what to use for generated paths.

Dends what you want to do with them. My ofn-stroke-fill-paths can generate a layer for each where the path is filled or outlined.

(06-15-2024, 07:27 AM)rinaldop Wrote: In order to get images of the full slice of the circle and not just the pointer I was not sure if I needed to do the steps listed in the post at the end of page 1 AND the steps listed above or just the steps listed above.

Neither. What you want is to use the One path per mark option in  ofn-dial-marks so that you get individual paths for each mark, that ofn-stroke-fill-paths will render as one layer per mark.

[attachment=12001]

(06-15-2024, 07:27 AM)rinaldop Wrote: Also what does rename the bottom layer to set it to `(replace) do?

It resets the image to an image with only one mark on it, otherwise the next cycle with paint marks over existing marks and after the first cycle you will just have a full circle that doesn't appear to change.

(06-15-2024, 07:27 AM)rinaldop Wrote: I assume that the final step is to export all layers, correct?  

No, if you want an animation, the final step it to export the image as an animation in a format that allows it (GIF or WebP). No neddx to export the mayers unless you want to create the animation by othe means.


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

(06-15-2024, 09:12 AM)Ofnuts Wrote:
(06-15-2024, 07:27 AM)rinaldop Wrote: I also need to know what to use for generated paths.

Dends what you want to do with them. My ofn-stroke-fill-paths can generate a layer for each where the path is filled or outlined.

(06-15-2024, 07:27 AM)rinaldop Wrote: In order to get images of the full slice of the circle and not just the pointer I was not sure if I needed to do the steps listed in the post at the end of page 1 AND the steps listed above or just the steps listed above.

Neither. What you want is to use the One path per mark option in  ofn-dial-marks so that you get individual paths for each mark, that ofn-stroke-fill-paths will render as one layer per mark.

I do not understand why you say neither because then you say to use ofn-stroke-fill-paths which was the instructions in your last post before this so I went back to that post and did this

[Image: attachment.php?aid=11984]


After doing that it worked already yesterday! I just realized that yesterday I had exactly what I wanted all along!

I finally realized why I thought I  made a mistake.

Since I do want to create the animation by other means I exported all layers

This was my starting image (I no longer want a blue circle but slices of this to fill from 0 degrees to 360 degrees

[attachment=12002]

After I was done I did get 10 images like this that DID do 360 degrees

[attachment=12003]

Looking over what I did yesterday I now realize why my output images where a blue slice, it is because in ofn-stroke-fill-paths the color source was set to foreground color!

I just need to know if it is possible to get slices of the original image instead of foreground color, gradient, or palette.  

I realize that I am asking for a lot of your time but I -really- appreciate your patience!

Thank you


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

I was able to export it as a .gif animation and it worked just as yours did! Now is it possible to save the images as they grow, meaning image 1 is 3.6 degrees, image 2 is 7.2 degrees, etc. so I can create the animation elsewhere.


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

You animation application should support the equivalent of (combine), it is part of the GIF standard.

Otherwise try my ofn-export-layers-cumulative script which is designed for this.


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

(06-16-2024, 07:23 AM)Ofnuts Wrote: You animation application should support the equivalent of (combine), it is part of the GIF standard.

Otherwise try my ofn-export-layers-cumulative script which is designed for this.

I am sorry but I have no idea what I am doing wrong. I start with an image and then I run  ofn-dial-marks and then I run
ofn-stroke-fill-path and get my layers . I then run ofn-export-layers-cumulative with the parameter
 {imageName}-{layersAll}-{index0}.png and I get only one image saved, the bottom layer.

What am I doing wrong?

Thanks


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

{layersAll} is probably generating a name tool long for you operating system. Try a name pattern something that remains short, such as {imageName}-{topLayer}.png, and make sure that all layers are visible and chain-linked.

[attachment=12005]