GimpTalk
http://www.gimptalk.com/forum/

execute liquid rescale+gimp in windows console
http://www.gimptalk.com/forum/viewtopic.php?f=2&t=37395
Page 1 of 1

Author:  adrock [ Sun Feb 01, 2009 4:36 am ]
Post subject:  execute liquid rescale+gimp in windows console

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

Author:  PhotoComix [ Sun Feb 01, 2009 2:59 pm ]
Post subject:  Re: execute liquid rescale+gimp in windows console

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

Author:  saulgoode [ Sun Feb 01, 2009 3:16 pm ]
Post subject:  Re: execute liquid rescale+gimp in windows console

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.

Author:  adrock [ Mon Feb 02, 2009 7:34 am ]
Post subject:  Re: execute liquid rescale+gimp in windows console

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!

Author:  adrock [ Mon Feb 02, 2009 8:30 am ]
Post subject:  Re: execute liquid rescale+gimp in windows console

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?

Author:  saulgoode [ Mon Feb 02, 2009 4:09 pm ]
Post subject:  Re: execute liquid rescale+gimp in windows console

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.

Author:  PhotoComix [ Mon Feb 02, 2009 5:30 pm ]
Post subject:  Re: execute liquid rescale+gimp in windows console

usually he answer quickly if you use help forum here http://liquidrescale.wikidot.com/

Author:  adrock [ Mon Feb 02, 2009 9:39 pm ]
Post subject:  Re: execute liquid rescale+gimp in windows console

thanks guys, I appreciate it! =)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/