Gimp-Forum.net
How automate crops of an image - 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: How automate crops of an image (/Thread-How-automate-crops-of-an-image)

Pages: 1 2


How automate crops of an image - stevem0 - 08-12-2020

I have searched for an answer, but can not seem to find a solution, so I apologize for asking if already answered.  (I have read thru slicing, guilotine etc.)

I need to take different segmented crops of an image.  Say my image is 100 tall by 2000 wide (100x2000 pixels)

How do I automatically crop an image 100x750 starting x=0 and crop every 10 pixels and save each image to file?

I want to crop all images 100 tall and 750 wide.  100x750

I want to crop every 10 pixels

image 1; x=0
image 2; x=10
image 3; x=20
;
;
;
image 126; x=1250

When it is complete I will have 126 images saved in a folder.  

Thank You


RE: How automate crops of an image - Ofnuts - 08-12-2020

No way I know without writing a specific script. But the only purpose I can see for this is that you want to do some animation. In which case maybe you should try my ofn-scroll-layer script?


RE: How automate crops of an image - stevem0 - 08-12-2020

(08-12-2020, 08:35 AM)Ofnuts Wrote: No way I know without writing a specific script. But the only purpose I can see for this is that you want to do some animation. In which case maybe you should try my ofn-scroll-layer script?

Thank You, On step one in the html guide, it says:
"The script is started by the Layer>Scroll layer menu."

I can not find the Scroll Layer menu.  I am using Windows10, was 2.8, but updated to 2.10 and still no Scroll Layer menu.  IF this is only avaliable on my linux machine, I will pull that out and give it a try.

[Image: dbRsHW7.png]


RE: How automate crops of an image - Kevin - 08-12-2020

Where did you put the ofn-scroll-layer.py file?


RE: How automate crops of an image - denzjos - 08-12-2020

Windows 10 / Gimp 2.10.20

[attachment=4738]

[attachment=4739]


RE: How automate crops of an image - stevem0 - 08-12-2020

Here is close to the exact operation I want to do:
Set initial rectangle select 0,0,750,100

[Image: 6zTkBdH.png]

Cntrl-c
Shift+Cntl+V
Shift+Cntl+S
 (Save as:  IMG-1.xcf)


Adjust selection area by 10:

[Image: JRA7s9J.png]

Cntrl-c
Shift+Cntl+V
Shift+Cntl+S
 (Save as:  IMG-2.xcf)

And Repeat till:

[Image: FMRdjFz.png]

Cntrl-c
Shift+Cntl+V
Shift+Cntl+S
 (Save as:  IMG-126.xcf)

(08-12-2020, 02:47 PM)Kevin Wrote: Where did you put the ofn-scroll-layer.py file?

[Image: oUq56MG.png]


RE: How automate crops of an image - Ofnuts - 08-12-2020

The script works with both 2.8 and 2.10. No special setup required (but it should be in the plugins directory, not in the scripts one) On Linux & OSX it should have the executable flag (but this flag should already be set when you unzip).


RE: How automate crops of an image - stevem0 - 08-12-2020

(08-12-2020, 02:49 PM)denzjos Wrote: Windows 10 / Gimp 2.10.20

Got it, Thank You.  It shows up on the bottom of my menu tho, dont think that creates any problems?
[Image: PtU1IV1.png]


RE: How automate crops of an image - Ofnuts - 08-12-2020

(08-12-2020, 03:58 PM)stevem0 Wrote:
(08-12-2020, 02:49 PM)denzjos Wrote: Windows 10 / Gimp 2.10.20
Got it, Thank You.  It shows up on the bottom of my menu tho, dont think that creates any problems?

That's where it is for me...


RE: How automate crops of an image - stevem0 - 08-12-2020

I have read thru the html help document,  ofn-scroll-layer.html

I got it as close as I could and it was in some loop, I had to kill the app.  I am a little confused on the waves and amplitude.

If my image is (x,y)  (Horizontal, Vertical)  (2000,100)
What settings should I use to create layers that are 750x100, With starting point = 0 and then 10 pixel increments in horizontal?

Thank You.
[Image: n4253LW.png]