You are here

Gimp via CLI

Hi !

I have wrote script for school project in script fu ...Now I need to compare processing time of this script with another. So I need to run it via CLI command time..... It suppose to be easy, but I do not know how to use numeric parameters...

This script is >

(define (script-fu-imgp theImg layer BorderColor theTextSign theTextFont)
(let*
(
(width (car (gimp-image-width theImg)) )
(height (car (gimp-image-height theImg)) )
(finalWidth 400)
(finalHeight 200)
(scaleWidth finalWidth)
(scaleHeight finalHeight)
(ratio 1)
(r 0)
(borderX 10)
(borderY 15)
(signSize 40)
(signX (+ borderX (- finalWidth (* signSize 4))))
(signY (- finalHeight borderX 50 ))
); assign value
(if (< width height)
(gimp-image-rotate theImg ROTATE-90)
(set! r 1)
)
(cond
((= r 0)
(set! ratio (/ width height) )
(set! scaleHeight (* scaleWidth ratio)))
(else
(set! ratio (/ height width) )
(set! scaleHeight (* scaleWidth ratio))
)
)
(if (> finalHeight scaleHeight)
(set! finalHeight scaleHeight) ;Potrebne zmenit vyslednu vysku v pripade, ze je > ako skutocna inak crop vyhodi chybu,
)
(gimp-image-scale theImg scaleWidth scaleHeight)
(gimp-image-crop theImg finalWidth finalHeight 0 0)
(script-fu-addborder theImg layer borderX borderY BorderColor 0)
(car
(gimp-text-fontname
theImg
-1
signX
signY
theTextSign ;text
30 ;border
TRUE ;antialias
signSize ;size
PIXELS ;
theTextFont
)
)
))
(script-fu-register
"script-fu-imgp" ;func name
"Transformácia" ;menu label
"..." ;description
"Maros Korinek" ;author
"copyright 2011, " ;copyright notice
"October 27, 1997" ;date created
"" ;image type that the script works on
SF-IMAGE "theImg" 0
SF-DRAWABLE "layer" 0
SF-COLOR "Border Color" '(0 0 0) ;color variable
SF-STRING "Text" "Name" ;a string variable
; SF-ADJUSTMENT "Image width" '(640 128 4096 128 10 0 1) _na

SF-FONT "label" "fontName"
)
(script-fu-menu-register "script-fu-imgp" "/script-fu/")

Thank you so much for your help :)

ap

See:

http://www.gimp.org/tutorials/Basic_Batch/

For your case, something like:

gimp -i -b '(script-fu-imgp "foo.png" (0 0 0) "bar" "Fontname" )' -b '(gimp-quit 0)'

Subscribe to Comments for "Gimp via CLI"