Gimptalk - Premier Gimp Community: Help Vintage Script in the promt - Gimptalk - Premier Gimp Community

Jump to content

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

Help Vintage Script in the promt

#1 User is offline   lothardan 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 10-May 11

Posted 10 May 2011 - 04:41 AM

Hi everyone i have the next script :

(define (fut filename)
(let*
((image(car(gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-drawable img)))
(vintage-look image drawable 17 20 59 TRUE)
)
(gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY)
(set! drawable (car (gimp-image-get-active-drawable image)))
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
)


And i run that with : gimp --console-messages --no-data --no-interface -b '(fut "1.jpg")' -b '(gimp-quit 0)'

No error!! But the problem is that the script dont affect the Image , what wrong whith the script .


Thank you
0

#2 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 385
  • Joined: 01-June 05
  • LocationUK

Posted 10 May 2011 - 09:47 AM

View Postlothardan, on 10 May 2011 - 04:41 AM, said:

Hi everyone i have the next script :

(define (fut filename)
(let*
((image(car(gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-drawable img)))
(vintage-look image drawable 17 20 59 TRUE)
)
(gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY)
(set! drawable (car (gimp-image-get-active-drawable image)))
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
)


And i run that with : gimp --console-messages --no-data --no-interface -b '(fut "1.jpg")' -b '(gimp-quit 0)'

No error!! But the problem is that the script dont affect the Image , what wrong whith the script .


Thank you


I can't be sure because I don't know what your vintage-look command does, but I think you need to have it outside the let* definition block:

(define (fut filename)
  (let*
	(
    	(image(car(gimp-file-load RUN-NONINTERACTIVE filename filename)))
    	(drawable (car (gimp-image-get-active-drawable img)))
	)
	(vintage-look image drawable 17 20 59 TRUE)
	(gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY)
	(set! drawable (car (gimp-image-get-active-drawable image)))
	(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
	(gimp-image-delete image)
  )
)


Kevin
Kevin
0

#3 User is offline   lothardan 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 10-May 11

Posted 10 May 2011 - 04:42 PM

Hi Thanks you for the quick answer, no , your code generete a error " batch command experienced an execution error " , the vintage-look script has the next code:



; The GIMP -- an image manipulation program
; Copyright (C) 1995 Spencer Kimball and Peter Mattis
; 
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
; 
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; 
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;
;
; Copyright (C) 2008 Michael Maier info[at]mmip.net
;
; Version 0.1 - Simulating a vintage photo based on this tutorial:
;               http://crazymurdock1.deviantart.com/art/Vintage-look-in-Gimp-61841683
; Version 0.2 - Optional sharpness and contrast layer
;               by Samuel Albrecht (http://registry.gimp.org/node/8718)
;
;

(define
  (vintage-look   img	
                  drw	
                  VarCyan
                  VarMagenta
                  VarYellow
                  Sharpen
                  )
  
  (let* ((drawable-width (car (gimp-drawable-width drw)))
         (drawable-height (car (gimp-drawable-height drw)))
         (new-image (car (gimp-image-new drawable-width drawable-height RGB)))
         (original-layer (car (gimp-layer-new new-image
                                              drawable-width drawable-height
                                              RGB-IMAGE "Original"
                                              100 NORMAL-MODE)))
         (cyan-layer 0)
         (magenta-layer 0)
         (yellow-layer 0)
         (sharpen-layer (car (gimp-layer-copy drw FALSE)))
         )
    
    ;Begin
    (gimp-undo-push-group-start img)
    (gimp-image-add-layer new-image original-layer 0)
    
    ;Sharpness + Contrast Layer
    (if(= Sharpen TRUE)
       (begin
         (gimp-image-add-layer img sharpen-layer -1)
         (gimp-desaturate-full sharpen-layer DESATURATE-LIGHTNESS)
         (plug-in-unsharp-mask 1 img sharpen-layer 5 1 0)
         (gimp-layer-set-mode sharpen-layer OVERLAY-MODE)
         )
       )
    
    ;Yellow Layer
    (set! yellow-layer (car (gimp-layer-new img drawable-width drawable-height RGB "color layer" 100  NORMAL)))	
    (gimp-image-add-layer img yellow-layer -1)
    (gimp-drawable-set-name yellow-layer "yellow")
    (gimp-context-set-background '(251 242 163) )
    (gimp-drawable-fill yellow-layer BACKGROUND-FILL)
    (gimp-layer-set-opacity yellow-layer VarYellow)
    (gimp-layer-set-mode yellow-layer MULTIPLY-MODE)
    
    ;Magenta Layer
    (set! magenta-layer (car (gimp-layer-new img drawable-width drawable-height RGB "color layer" 100  NORMAL)))	
    (gimp-image-add-layer img magenta-layer -1)
    (gimp-drawable-set-name magenta-layer "magenta")
    (gimp-context-set-background '(232 101 179) )
    (gimp-drawable-fill magenta-layer BACKGROUND-FILL)
    (gimp-layer-set-opacity magenta-layer VarMagenta)
    (gimp-layer-set-mode magenta-layer SCREEN-MODE)
    
    ;Cyan Layer 
    (set! cyan-layer (car (gimp-layer-new img drawable-width drawable-height RGB "color layer" 100  NORMAL)))	
    (gimp-image-add-layer img cyan-layer -1)
    (gimp-drawable-set-name cyan-layer "cyan")
    (gimp-context-set-background '(9 73 233) )
    (gimp-drawable-fill cyan-layer BACKGROUND-FILL)
    (gimp-layer-set-opacity cyan-layer VarCyan)
    (gimp-layer-set-mode cyan-layer SCREEN-MODE)
    
    ;End
    ;(gimp-image-flatten img)
    (gimp-displays-flush)
    (gimp-undo-push-group-end img)
    )
  )

(script-fu-register "vintage-look"
                    "<Image>/Script-Fu/Vintage-Look"
                    
                    "
                    Simulation of a vintage look.
                    Last version can be found at:
                    http://registry.gimp.org/node/1348
                    "
                    
                    "Michael Maier info[at]mmip.net >" 
                    "(c) Michael Maier. This is GPL Free Software." 	
                    "March 3, 2008" 
                    ""	
                    
                    SF-IMAGE      "Image"    0
                    SF-DRAWABLE   "Drawable" 0
                    SF-ADJUSTMENT _"Cyan"    '(17 0 100 1 1 0 0)
                    SF-ADJUSTMENT _"Magenta" '(20 0 100 1 1 0 0)
                    SF-ADJUSTMENT _"Yellow"  '(59 0 100 1 1 0 0)
                    SF-TOGGLE     _"Sharpen"  TRUE
                    )



The script is from http://registry.gimp.org/node/1348 , and works perfectly if i use it from the Gimp menu.

Another Idea??

Thnak You
0

#4 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 385
  • Joined: 01-June 05
  • LocationUK

Posted 10 May 2011 - 09:39 PM

Found it!

You have a typo:

the line
(drawable (car (gimp-image-get-active-drawable img)))


should be
(drawable (car (gimp-image-get-active-drawable image)))



I found it by creating a register block for your fut function and running it from the gimp menu - you get slightly better error messages:

(define (fut filename)
  (let*
    	(
    	(image(car(gimp-file-load RUN-NONINTERACTIVE filename filename)))
    	(drawable (car (gimp-image-get-active-drawable img)))
    	)
    	(vintage-look image drawable 17 20 59 TRUE)
    	(gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY)
    	(set! drawable (car (gimp-image-get-active-drawable image)))
    	(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
    	(gimp-image-delete image)
  )
)

(script-fu-register "fut"
                	"<Image>/contributed/fut"
                	
                	"
                	Simulation of a vintage look.
                	Last version can be found at:
                	http://registry.gimp.org/node/1348
                	"
                	
                	"Michael Maier info[at]mmip.net >" 
                	"(c) Michael Maier. This is GPL Free Software." 	
                	"March 3, 2008" 
                	""	
                	SF-FILENAME "file" ""                	
                	)


Gave the Error:
Error while executing fut:

Error: eval: unbound variable: img 


Kevin
Kevin
0

#5 User is offline   lothardan 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 10-May 11

Posted 11 May 2011 - 01:58 AM

Thank you again for your answer No more error! but the photo don't have any change , Any idea?
There is an other way to call an other script from comand line ?

Thanks

0

#6 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 385
  • Joined: 01-June 05
  • LocationUK

Posted 11 May 2011 - 06:08 AM

What operating system are you running this on? Windows, Linux, Mac? I ask because it now sounds like your command line is wrong.

If you are running on Windows you could try:

gimp --console-messages --no-data --no-interface -b "(fut \"1.jpg\")" -b "(gimp-quit 0)"

as the single quotes ' don't work

Kevin
Kevin
0

#7 User is offline   lothardan 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 10-May 11

Posted 11 May 2011 - 08:52 AM

View Postpaynekj, on 11 May 2011 - 06:08 AM, said:

What operating system are you running this on? Windows, Linux, Mac? I ask because it now sounds like your command line is wrong.

If you are running on Windows you could try:

gimp --console-messages --no-data --no-interface -b "(fut \"1.jpg\")" -b "(gimp-quit 0)"

as the single quotes ' don't work

Kevin



Hi!! , is a Linux Box
0

#8 User is offline   paynekj 

  • Member
  • PipPip
  • Group: Members
  • Posts: 385
  • Joined: 01-June 05
  • LocationUK

Posted 11 May 2011 - 09:12 AM

It works OK on my Windows box (with the corrections above):
"C:\Program Files\GIMP-2.0\bin\gimp-2.6.exe" --console-messages --no-data --no-interface -b "(fut \"prawn.jpg\")" -b "(gimp-quit 0)"


Kevin
Kevin
0

#9 User is offline   lothardan 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 10-May 11

Posted 14 May 2011 - 03:30 AM

View Postpaynekj, on 11 May 2011 - 09:12 AM, said:

It works OK on my Windows box (with the corrections above):
"C:\Program Files\GIMP-2.0\bin\gimp-2.6.exe" --console-messages --no-data --no-interface -b "(fut \"prawn.jpg\")" -b "(gimp-quit 0)"


Kevin



I don't have any windows box to try it, mmm.. talking about linux any other idea ?

Thank you again for your quick answers :)
0

Share this topic:


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