Post Reply 

TinyScheme Color

Apr 5, 2011, 16:47
Post: #1
TinyScheme Color
Hello People,

I'm trying to control Gimp in console mode.

I want to pass some colors in arguments to the following script :
Code:
(define (myScript filename jvar1 jvar2  jvar3)
   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
          (drawableChannel (car (gimp-image-get-active-channel image)))
          (selection (car (gimp-image-get-selection image)))
        (width (car (gimp-drawable-width image)))
            (height (car (gimp-drawable-height image)))
            (drawable (car (gimp-image-get-active-layer image))))

    (gimp-context-set-background '(jvar1 jvar2 jvar3))
[etc...]

The script then uses the color (i select stuff and fill them with it).

I call the script by the following command :
Code:
gimp -i -b '(myScript  "/home/alexis[/quote]/chart.png" 15 80 50)' -b '(gimp-quit 0)'^C

My problem is the following : the color rendered is fully white.

My understanding is that the jvars are somehow converted to 255.

Could somebody help me to fix that ?

Thanks,
Alexis.
Find all posts by this user
Quote this message in a reply
Apr 5, 2011, 19:47
Post: #2
RE: TinyScheme Color
Try with floats where 1.0 is 255: .06, .31, .20

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Sep 6, 2011, 02:18
Post: #3
RE: TinyScheme Color
Code:
    (gimp-context-set-background '(jvar1 jvar2 jvar3))

The problem is how you have defined the list with the colour values. What you have done will create a list with three symbols instead of a list with the value of each variable.

Change '(jvar1 jvar2 jvar3) to (list jvar1 jvar2 jvar3).
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Color menuitems in script or plugin Barbie 4 468 Sep 29, 2014 09:51
Last Post: paynekj
  Script fu and Color to alpha john 4 469 Sep 20, 2014 08:46
Last Post: rich2005
  Easy Color gfb 2 540 May 4, 2014 02:05
Last Post: gfb
  'do not write color space information' in script-fu eab 0 507 Aug 13, 2013 10:03
Last Post: eab
  Color Balance Midi Lessbones 3 1,050 Dec 24, 2012 20:25
Last Post: Lessbones

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS