It is currently Thu Apr 18, 2024 6:46 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 12:16 pm  (#1) 
Offline
New Member

Joined: Jun 16, 2017
Posts: 3
Hi - I'm a new GIMP user, and am trying to automate something without spending a whole paycheck on Photoshop!

Is this possible?

1. Resize image to pre-determined dimensions (number of pixels x and y)
2. Divide image into quarters and save the four separate image files. i.e. x/2 and y/2.

I have a bunch of images to do this for...


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 12:46 pm  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Yes it's possible.
1. What are the predetermined dimensions?
2. How do you want to name the 4 images to be saved?

_________________
TinT


Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 12:52 pm  (#3) 
Offline
New Member

Joined: Jun 16, 2017
Posts: 3
Images all start at 7040x4640 pixels.

I would like the original filename with a suffix added to indicate which crop. Ideally the suffixes would be "NW" for the top-left, "NE" for the top-right, "SW" for the bottom-left, and "SE" for the bottom-right crop......however the suffix isn't that important as long as it's unique.


Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 1:43 pm  (#4) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Here's a script to start
(unzip it and put it in your GIMP's /plug-ins/ folder. Restart GIMP.)
Attachment:
quadSave.zip [1.37 KiB]
Downloaded 91 times

Just have an blank image with a blank layer opened.
Run script it'll be under Python-Fu/Quad Save...
choose input folder/directory where your jpg files are located.
chose output folder where the new jpg files will be saved.
Then OK to run script it'll open up each jpg file in the input folder scale them to your indicated dimensions,
select the quadrants and saves them as jpgs with NW,NE,SW,SE appended to file name before the extension .jpg.

Give a try and let me know if that works for you.

_________________
TinT


Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 2:12 pm  (#5) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2419
Looks like trandoductin gives the Gimp solution.

An alternative is using a command line application ImageMagick
http://imagemagick.org/script/download.php
down the bottom of the page for Windows installers.

Only two commands required so not worth writing a batch file. Note the mogrify command overwrites the files so work on copies.

resize
magick mogrify -resize width!xheight! *.jpg


split into quarters
magick mogrify -crop half-width!xhalf-height! +repage *.jpg


or *.png depending on filetype

A video demo of the process https://youtu.be/fjT6FNnPE48 3 minutes duration

_________________
Image


Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 2:13 pm  (#6) 
Offline
New Member

Joined: Jun 16, 2017
Posts: 3
Wow thank you!!!!

I'll try this weekend and let you know how it works.


Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Fri Jun 16, 2017 2:31 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12643
Location: Spain, Aragón
Welcome to Gimp Chat, desertspx :)


Attachments:
Welcome.JPG
Welcome.JPG [ 199.53 KiB | Viewed 2132 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Sat Jun 17, 2017 3:49 am  (#8) 
Offline
Global Moderator
User avatar

Joined: Apr 01, 2012
Posts: 7712
Location: On the other side of this screen
Welcome to Gimp Chat desertspx :gimp

_________________


Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Sun Jun 18, 2017 6:31 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Mar 23, 2012
Posts: 7304
Location: Göteborg at last!
Hi desertspx, welcome to GC.


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group