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


Board index » GimpTalk » GIMP General Help 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   [ 8 posts ]  


Author Message
Offline
 Post subject: execute liquid rescale+gimp in windows console
PostPosted: Sun Feb 01, 2009 4:36 am 

Joined:
Sun Feb 01, 2009 4:30 am

Topics:
Posts: 4

Find User's Topics

Is there a way to execute gimp from windows console using the liquid rescale plugin to resize an image and output that image to a directory?

I have been looking through the tutorials, and I have been trying to understand the scripting. I am hoping that there is just a single command line I can do this with, any ideas?

Thanks

-Jeff



Top
 Profile E-mail  
 
Online
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Sun Feb 01, 2009 2:59 pm 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10074

Find User's Topics
You may ask also in the Forum here http://liquidrescale.wikidot.com/ Now liquid resize is also a library

_________________
Image

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


Top
 Profile  
 
Offline
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Sun Feb 01, 2009 3:16 pm 
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics:
Posts: 5017

Find User's Topics
GIMP can execute Script-fu commands passed to it on the command line using the '-b' switch. Unfortunately, Windows console is rather lame and makes passing complicated scripts in this manner rather difficult.

I would recommend creating a file similar to the following and saving it to your GIMP scripts directory:
Code:
(define (batch-gimp-lqr filename
                        width height
                        pres-layer pres-coeff
                        disc-layer disc-coeff
                        rigidity rigidity-mask-layer delta-x
                        resize-aux-layers resize-canvas
                        new-layer seams grad-func res-order
                        mask-behavior oper-mode
                        no-disc-on-enlarge pres-layer-name
                        disc-layer-name rigmask-layer-name
                        )
  (let* (
      (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
      (drawable (car (gimp-image-get-active-layer image)))
      )
    (plug-in-lqr RUN-NONINTERACTIVE image drawable
                 width height
                 pres-layer pres-coeff
                 disc-layer disc-coeff
                 rigidity rigidity-mask-layer delta-x
                 resize-aux-layers resize-canvas  new-layer seams
                 grad-func res-order
                 mask-behavior oper-mode
                 no-disc-on-enlarge pres-layer-name
                 disc-layer-name rigmask-layer-name
                 )
    )
  )


This definition will make it easier for you to invoke the liquid rescale plug-in from the command line. As you can see, it basically opens a named file as an image and then runs the filter on that image.

The command to invoke GIMP with file would appear similar to the following (may need to be on a single line in Windows):

gimp -i -f -b "(batch-gimp-lqr \"filename\"
100 100
0 1000
0 1000
0 0 1
TRUE TRUE FALSE FALSE
0 0
0 0
TRUE \"\"
\"\" \"\" )" -b "(gimp-quit 0)"


You may wish to hardcode some reasonable defaults in your script file (similar to how RUN-NONINTERACTIVE was hardcoded) so that you don't need to include so many parameters on your command line.

_________________
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.


Top
 Profile  
 
Offline
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Mon Feb 02, 2009 7:34 am 

Joined:
Sun Feb 01, 2009 4:30 am

Topics:
Posts: 4

Find User's Topics
saulgoode:

Thank you so much for your time.

I am currently playing with the script in the script-fu console, I am getting errors but I am progressing, I will keep you posted =) thanks again!


Top
 Profile E-mail  
 
Offline
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Mon Feb 02, 2009 8:30 am 

Joined:
Sun Feb 01, 2009 4:30 am

Topics:
Posts: 4

Find User's Topics
Ok, I have been trying different combos in the Script-Fu console for a while now, but I can't seem to get past the error

> (batch-gimp-lqr "c:\\h.jpg" 100 100 0 1000 0 1000 0 0 1 TRUE TRUE FALSE FALSE 0 0 0 0 TRUE "" "" "") (gimp-quit 0)
Error: Procedure execution of plug-in-lqr failed on invalid input arguments

GIMP says opening the image, but fails with that error.
any ideas?


Top
 Profile E-mail  
 
Offline
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Mon Feb 02, 2009 4:09 pm 
User avatar

Joined:
Mon Aug 22, 2005 8:35 pm

Topics:
Posts: 5017

Find User's Topics
You might have to contact the plug-in's authors about how to call LQR from a script. The source code seems to indicate that when run non-interactively, the plug-in only expects five parameters, but its PDB registration demands 24 parameters.

_________________
Everybody makes their own fun. If you don't make it yourself it's not fun, it's entertainment.


Top
 Profile  
 
Online
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Mon Feb 02, 2009 5:30 pm 
GT Manager

User avatar

Joined:
Mon Jun 13, 2005 11:15 am

Topics:
Posts: 10074

Find User's Topics
usually he answer quickly if you use help forum here http://liquidrescale.wikidot.com/

_________________
Image

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


Top
 Profile  
 
Offline
 Post subject: Re: execute liquid rescale+gimp in windows console
PostPosted: Mon Feb 02, 2009 9:39 pm 

Joined:
Sun Feb 01, 2009 4:30 am

Topics:
Posts: 4

Find User's Topics
thanks guys, I appreciate it! =)


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

Post new topic Reply to topic
 [ 8 posts ] 



Who is online

Users browsing this forum: Pocky, RobA, vincecate and 7 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