Gimptalk - Premier Gimp Community: execute liquid rescale+gimp in windows console - Gimptalk - Premier Gimp Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

execute liquid rescale+gimp in windows console

#1 User is offline   adrock 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-February 09

Posted 01 February 2009 - 04:36 AM

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
0

#2 User is offline   PhotoComix 

  • GT Senior Moderator
  • Group: Senior Moderators
  • Posts: 11,256
  • Joined: 13-June 05

Posted 01 February 2009 - 02:59 PM

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

#3 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 01 February 2009 - 03:16 PM

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:
(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.
0

#4 User is offline   adrock 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-February 09

Posted 02 February 2009 - 07:34 AM

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!
0

#5 User is offline   adrock 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-February 09

Posted 02 February 2009 - 08:30 AM

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?
0

#6 User is offline   saulgoode 

  • Retired Staff
  • PipPipPip
  • Group: Retired Staff
  • Posts: 5,324
  • Joined: 22-August 05

Posted 02 February 2009 - 04:09 PM

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.
0

#7 User is offline   PhotoComix 

  • GT Senior Moderator
  • Group: Senior Moderators
  • Posts: 11,256
  • Joined: 13-June 05

Posted 02 February 2009 - 05:30 PM

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

#8 User is offline   adrock 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 01-February 09

Posted 02 February 2009 - 09:39 PM

thanks guys, I appreciate it! =)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic