GimpTalk Announcement :
Try your digital-art skills against your fellow gimpers in GIMPtalk's Biweekly Art competition !


Board index » GIMP Art Galleries and Resources » GIMP Plugins, Filters, and Scripts Web Development Services . Convert FLV to Cell Phone Format
Featured Tutorial : Learn how to create characters by Griatch
Search for :  


Post new topic Reply to topic   [ 11 posts ]  


Author Message
Offline
 Post subject:
PostPosted: Sat Sep 16, 2006 8:31 pm 

Joined:
Sat Aug 26, 2006 12:10 pm

Topics:
Posts: 17

Find User's Topics

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.de/dl/batch-resize-2.2.scm (for GIMP 2.2)
http://www.gimpusers.de/dl/batch-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.de/tutorials/script-fu-batch-resize.html


_________________
gimpusers.de


Top
 Profile  
 
Offline
 Post subject:
PostPosted: Sat Sep 16, 2006 8:39 pm 
User avatar

Joined:
Sat Sep 09, 2006 5:47 pm

Topics:
Posts: 28

Find User's Topics
cant you just scale the image?

_________________
Image


Top
 Profile  
 
Offline
 Post subject:
PostPosted: Sat Sep 16, 2006 8:41 pm 

Joined:
Sat Aug 26, 2006 12:10 pm

Topics:
Posts: 17

Find User's Topics
I want to scale many images, e.g. the last holiday photos. This is why i need BATCH resize

_________________
gimpusers.de


Top
 Profile  
 
Online
 Post subject:
PostPosted: Sat Sep 16, 2006 10:58 pm 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10306

Find User's Topics
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


4 parameters i hope: i would like choose a folder for the resized images...or it will overwrite the originals?

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Offline
 Post subject:
PostPosted: Sat Sep 16, 2006 11:18 pm 

Joined:
Fri Aug 18, 2006 5:49 pm

Topics:
Posts: 4

Find User's Topics
it is intended to overwrite the original files.

you can make a copy first and then resize the duplicates.

regards,


Top
 Profile  
 
Online
 Post subject:
PostPosted: Sat Sep 16, 2006 11:25 pm 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10306

Find User's Topics
Thank

_________________
Image

http://www.flickr.com/photos/97844002@N00/


Top
 Profile  
 
Offline
 Post subject:
PostPosted: Thu Dec 27, 2007 9:55 pm 

Joined:
Thu Dec 27, 2007 9:50 pm

Topics:
Posts: 1

Find User's Topics
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.

[url]http://www.usaupload.net/d/nmet080o0k0[/url]


Top
 Profile  
 
Offline
 Post subject:
PostPosted: Wed Mar 26, 2008 7:00 pm 

Joined:
Wed Mar 26, 2008 6:44 pm

Topics:
Posts: 1

Find User's Topics
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!

Code:

(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"
          "<Toolbox>/Xtns/Misc")




Top
 Profile  
 
Offline
 Post subject:
PostPosted: Wed Apr 23, 2008 8:47 am 

Joined:
Wed Apr 23, 2008 8:45 am

Topics:
Posts: 1

Find User's Topics
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!


This is exactly what I have been looking for. Thank you for posting a scaling version!


Top
 Profile  
 
Offline
 Post subject: Re: script-fu batch resize
PostPosted: Mon Oct 13, 2008 7:36 pm 

Joined:
Wed Jul 26, 2006 11:09 am

Topics:
Posts: 38
Location: Maryland

Find User's Topics
This is awesome - You rock !!

_________________
Im MGSfan32! Nice to meet you!
Image


Top
 Profile E-mail  
 
Offline
 Post subject: Re: script-fu batch resize
PostPosted: Thu Oct 23, 2008 11:30 am 

Joined:
Thu Oct 23, 2008 11:28 am

Topics:
Posts: 1

Find User's Topics
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...


Top
 Profile E-mail  
 
Display posts from previous:  Sort by  

Post new topic Reply to topic
 [ 11 posts ] 



Who is online

Users browsing this forum: mm mike and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Related Website
Gimp tutorials database
All rights reserved © GimpTalk 2008
forum software by
phpBB