Page 1 of 1
script-fu batch resize
#1
Posted 16 September 2006 - 08:31 PM
I have made a Script-Fu to batch-resize images because I couldn't find one that only resizes images (only thumbnail gallerys etc.)
Just download and put to your scripts directory:
http://www.gimpusers...-resize-2.2.scm (for GIMP 2.2)
http://www.gimpusers...-resize-2.4.scm (for GIMP 2.4)
The script is German but it only has three parameters:
1) path to images, e.g. "/home/richard/tmp/*.jpg"
2) new width
3) new height
You can start the script from Xtns/Script-Fu/Verschiedenes/Mehrere Bilder verkleinern...
More images and detailled infos (text in German) are available at:
http://www.gimpusers...tch-resize.html
Just download and put to your scripts directory:
http://www.gimpusers...-resize-2.2.scm (for GIMP 2.2)
http://www.gimpusers...-resize-2.4.scm (for GIMP 2.4)
The script is German but it only has three parameters:
1) path to images, e.g. "/home/richard/tmp/*.jpg"
2) new width
3) new height
You can start the script from Xtns/Script-Fu/Verschiedenes/Mehrere Bilder verkleinern...
More images and detailled infos (text in German) are available at:
http://www.gimpusers...tch-resize.html
#3
Posted 16 September 2006 - 08:41 PM
I want to scale many images, e.g. the last holiday photos. This is why i need BATCH resize
#4
Posted 16 September 2006 - 10:58 PM
Quote
the script is German but it only has three parameters:
1) path to images, e.g. "/home/richard/tmp/*.jpg"
2) new width
3) new height
1) path to images, e.g. "/home/richard/tmp/*.jpg"
2) new width
3) new height
4 parameters i hope: i would like choose a folder for the resized images...or it will overwrite the originals?
#5
Posted 16 September 2006 - 11:18 PM
it is intended to overwrite the original files.
you can make a copy first and then resize the duplicates.
regards,
you can make a copy first and then resize the duplicates.
regards,
#7
Posted 27 December 2007 - 09:55 PM
I tried to use this with no luck and had to deal with it for the holiday's and a silly little electronic photo frame.
The 2.4 script doesn't work out of the box so I am submitting the updaed version for 2.4.
http://www.usaupload.net/d/nmet080o0k0
The 2.4 script doesn't work out of the box so I am submitting the updaed version for 2.4.
http://www.usaupload.net/d/nmet080o0k0
#8
Posted 26 March 2008 - 07:00 PM
Thank you :) Nice scripts :)
I made my own modification - using single aspect ratio instead of width & height. Some things in code are most possible redundant (e.g. recalculating ratio) so somebody probably can correct this. Anyway :) Hope it's okay to put code in here - no time for safe uploading.
Put all this inside scripts directory (on my computer it's c:\program files\GIMP-2.0\share\gimp\2.0\scripts) in a text file called e.g. batch-scale-ratio.scm) and reload the scripts in GIMP menu->Xtns->Script-fu->Refresh scripts
so then you can see it under GIMP menu->Xtns->Misc
cheers!
I made my own modification - using single aspect ratio instead of width & height. Some things in code are most possible redundant (e.g. recalculating ratio) so somebody probably can correct this. Anyway :) Hope it's okay to put code in here - no time for safe uploading.
Put all this inside scripts directory (on my computer it's c:\program files\GIMP-2.0\share\gimp\2.0\scripts) in a text file called e.g. batch-scale-ratio.scm) and reload the scripts in GIMP menu->Xtns->Script-fu->Refresh scripts
so then you can see it under GIMP menu->Xtns->Misc
cheers!
(define (script-fu-batch-scale-ratio globexp ratio)
(define (resize-img n f)
(let* ((fname (car f))
(img (car (gimp-file-load 1 fname fname))))
(let* (
(drawable (car (gimp-image-active-drawable img)))
(cur-width (car (gimp-image-width img)))
(cur-height (car (gimp-image-height img)))
(new-width (* ratio cur-width))
(new-height (* ratio cur-height))
(new_ratio (min (/ new-width cur-width) (/ new-height cur-height)))
(width (* new_ratio cur-width))
(height (* new_ratio cur-height))
)
(gimp-image-undo-disable img)
(gimp-image-scale img width height)
(gimp-file-save 1 img (car (gimp-image-get-active-drawable img)) fname fname)
(gimp-image-delete img)
)
)
(if (= n 1) 1 (resize-img (- n 1) (cdr f)))
)
(let* ((files (file-glob globexp 0)))
(resize-img (car files) (car (cdr files))))
)
(script-fu-register "script-fu-batch-scale-ratio"
_"Batch Image Scale By Ratio"
"Hey!"
"Nicholas Herring and Richard Hirner (http://www.gimptalk.com/forum/topic/Script-fu-Batch-Resi-e-9440-1.html) & ADP (http://www.adp-gmbh.ch/misc/tools/script_fu/ex_10.html), hello_earth"
"2008, Nicholas Herring based on a script by Richard Hirner"
"March 26, 2008"
""
SF-STRING "Full path with wildcards" "C:\\Test\\*.jpg"
SF-VALUE "Scaling ratio (min 0.01, max 1)" "0.50")
(script-fu-menu-register "script-fu-batch-scale-ratio"
"/Xtns/Misc")
#9
Posted 23 April 2008 - 08:47 AM
Quote
Thank you :) Nice scripts :)
I made my own modification - using single aspect ratio instead of width & height. Some things in code are most possible redundant (e.g. recalculating ratio) so somebody probably can correct this. Anyway :) Hope it's okay to put code in here - no time for safe uploading.
Put all this inside scripts directory (on my computer it's c:\program files\GIMP-2.0\share\gimp\2.0\scripts) in a text file called e.g. batch-scale-ratio.scm) and reload the scripts in GIMP menu->Xtns->Script-fu->Refresh scripts
so then you can see it under GIMP menu->Xtns->Misc
cheers!
I made my own modification - using single aspect ratio instead of width & height. Some things in code are most possible redundant (e.g. recalculating ratio) so somebody probably can correct this. Anyway :) Hope it's okay to put code in here - no time for safe uploading.
Put all this inside scripts directory (on my computer it's c:\program files\GIMP-2.0\share\gimp\2.0\scripts) in a text file called e.g. batch-scale-ratio.scm) and reload the scripts in GIMP menu->Xtns->Script-fu->Refresh scripts
so then you can see it under GIMP menu->Xtns->Misc
cheers!
This is exactly what I have been looking for. Thank you for posting a scaling version!
#11
Posted 23 October 2008 - 11:30 AM
Ok, so I tried to save that as what you said, into where you said etc. I have looked around, but I am really stupid by the looks of it.
All I wanted was a easy way to convert files from one size to another, pref. in a new folder.. with gimp 2.6... If anyone could help, please do...
All I wanted was a easy way to convert files from one size to another, pref. in a new folder.. with gimp 2.6... If anyone could help, please do...
#12
Posted 20 March 2010 - 12:15 PM
i was searching for the same thing for Gimp 2.6 and found this:
http://members.ozema...odsond/dbp.html
works perfectly for me!
Good luck!
http://members.ozema...odsond/dbp.html
works perfectly for me!
Good luck!
Share this topic:
Page 1 of 1

Help














