It is currently Wed Aug 16, 2017 9:53 am


Latest GIMP Scripts & Plug-ins

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: 2781
Location: Tin from Victoria BC Canada
Yes it's possible.
1. What are the predetermined dimensions?
2. How do you want to name the 4 images to be saved?

_________________
T.
Image


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: 2781
Location: Tin from Victoria BC 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 27 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.

_________________
T.
Image


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: 1143
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: 4823
Location: Spain, Aragón
Welcome to Gimp Chat, desertspx :)


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

_________________
Image
"There is no way to peace, peace is the way"
Top
 Post subject: Re: new user, trying to automate a task
PostPosted: Sat Jun 17, 2017 3:49 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Apr 01, 2012
Posts: 4665
Location: In front of my computer
Welcome to Gimp Chat desertspx :gimp

_________________
Image


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: 5933
Location: Göteborg at last!
Hi desertspx, welcome to GC.

_________________
Image


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group