1

HI Graphic Design friends,
I'm in trouble...
My question for you are these:

  • Can I create a GIMP/Inkscape template that once opened and inserted a photo crop exactly the same point in the same size?

  • If I can't create similar templates, can I make macros? If yes, how can I do?


The problem Sample:

Imagine having many similar images and having to crop the red boxes for each one

Normal i would cut this

How can I be accurate and fast?
Thanks for the helps.

11
4

No to both of your questions.

Inkscape can't edit/crop raster images at all. It's a vector image editor, so it's no use for what you want.

GIMP has no template functionality as such, other than regular XCF (GIMP document) files, but these can't "do" anything.

GIMP has no macro recording capabilities, although it can be scripted using ScriptFu or Python for automation. I've no idea how to script GIMP unfortunately.

It's possible to semi-automatically slice an image using Guides in GIMP. Although it will produce extra slices you will have to discard.

Example

enter image description here

4
  • This is a smart idea.. thanks – Lale Feb 1 at 10:14
  • you said GIMP has no template functionality, well that's quite right, I worked around it and found a solution: save the page with guides and use it for different images, not a real template but it's similar... Really thanks for it👍 – Lale Feb 5 at 11:23
  • I leave you the answer marked as accepted because you have provided for first a very good and elegant answer; thanks for the helps you give to me every time – Lale Feb 5 at 13:07
  • 1
    @Lale - thanks, but do you know you can actually accept your own answer as best? Since you eventually went with a different method, it might be better to select that as best. – Billy Kerr Feb 5 at 13:52
2

In Gimp you can record settings for most tools and the Crop tool is not exception.

enter image description here

On one image, set the crop tool to you liking (size & position), and click the "Save" icon (leftmost), and give a name to your settings.

Later on, start the crop tool, click on the image, then click the "Restore" icon (2nd from left) to restore the settings, and strike [Enter] to apply the crop.

If you want to do this to many images, it is worth investigating using ImageMagick in a shell script.

It is also possible to make a Gimp script (and assign a shortcut to your script...), but this is better asked on StackOverflow.

1
  • maybe I should ask since I've never write a Gimp script.. thanks for the idea – Lale Feb 1 at 10:16
1

Thanks to @DocBrown I'm finally succeeded to what I was looking for:
Making macros that cut Images in several section, many time, the same size.

How to use the Crop in Imagemagick

Using ImageMagick for windows I found the right idea using this website
Batch Crop Images With Imagemagick

How I make the Batch File

Using an Italian PDF that talks about Batch files I wrote a clear code that answers my request, and I would like to let you know because it could be useful to everyone:

    ECHO OFF   
    CLS 
    ECHO File To CUT ScreenShots png
    :: Clear The Directory cropped where I will put the imgs 
    RD /Q /S C:\Users\alessandro.golin\Desktop\CroPpED
    MD C:\Users\alessandro.golin\Desktop\CroPpED
    
    :: Starting crop 
    :: The Input file is called C_ToCrop.png 

    ECHO ---- FIXTURE Casambi Section----
     : Magick convert -crop [size (see the link)] [input.png] [output.png]
     magick convert -crop 579x99+30+199 C_ToCrop.png C_Fixture.png

     :: Displace the file cropped in the cropped directory, then delete the file on desktop
     COPY C:\Users\alessandro.golin\Desktop\C_Fixture.png C:\Users\alessandro.golin\Desktop\CroPpED
     DEL C:\Users\alessandro.golin\Desktop\C_Fixture.png

     :: Closing message
    ECHO ---- FIXTURE Casambi Displaced in CroPpED Directory ----
    
    ECHO ---- TEST Casambi Section----
     magick convert -crop 579x100+30+498 C_ToCrop.png C_Test.png
     COPY C:\Users\alessandro.golin\Desktop\C_Test.png C:\Users\alessandro.golin\Desktop\CroPpED
     DEL C:\Users\alessandro.golin\Desktop\C_Test.png
    ECHO ---- TEST Casambi Displaced in CroPpED Directory ----
    
    ECHO ---- UNIT Casambi Section----
     magick convert -crop 579x127+30+797 C_ToCrop.png C_Unit.png
     COPY C:\Users\alessandro.golin\Desktop\C_Unit.png C:\Users\alessandro.golin\Desktop\CroPpED
     DEL C:\Users\alessandro.golin\Desktop\C_Unit.png
    ECHO ---- UNIT Casambi Displaced in CroPpED Directory ----
    
    PAUSE

Thank you very much everyone for the helps and the efforts you have made to help me✨

1

This is actually super easy in Inkscape.

Select the image, then go to Object > Pattern > Object to Pattern. Next, draw your sections on top. Combine them. Select both, the image-pattern-rectangle and the cut lines. Path > Division.

3
  • yes, thanks for the good idea, but what I wanted to do was create a template, so every image I had to cut, I could automatically insert it into the template and cut without too many steps ... – Lale Feb 17 at 7:36
  • 1
    That's possible, too, if all images have the same size. Check gitlab.com/Moini/nextgenerator, or just exchange the image under the clip manually. You could do this more comfortably by using a clone and a group. But yes, I would also use imagemagick for cropping a bunch of raster images :) – Moini Feb 18 at 11:49
  • Thanks for the ideas, I looked at the link you give me, well next time I will check it, thanks; The problem is I'm lazy :) so if I only just have to on double click an .exe, I much prefer it✨... also because I have upgraded the batch and now it moves the files I cut directly to the correct destination folders. Automation is the wonder of computers – Lale Feb 18 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.