Post Reply 

Script-Fu: script does not work properly

May 14, 2011, 21:57
Post: #1
Script-Fu: script does not work properly
Hi gimp-users,
i try to get used to script-fu, but it seems very hard for me.
Now i have written a script and it can be registered in gimp, too, but when i execute it, there seems to be no effect. What should happen, is, that the script should duplicate the current layer. I would appreciate if you can have a look at it and give me some hint.



(define(script-fu-color-adjustment inImage inLayer)
(gimp-undo-push-group-start inImage)

(cp-layer (car (gimp-layer-copy inLayer 1)))

(gimp-image-add-layer cp-layer -1)

(gimp-undo-push-group-end inImage)

(script-fu-register "script-fu-color-adjustment"
"Color Adjustment"
"this script creates some layers\
to adjust the color settings"
"Tobias Wessels"
"copyright 2011, TW"
"May 14, 2011"
SF-IMAGE "inImage" 0
SF-DRAWABLE "inLayer" 0
(script-fu-menu-register "script-fu-color-adjustment"
Find all posts by this user
Quote this message in a reply
May 15, 2011, 13:57
Post: #2
RE: Script-Fu: script does not work properly
Ok, I will have to learn more about the differences of python and scheme and their preferences. But so far i managed to write down the whole script and get it working. Now there is just a little feature left.

In my script i am working with gimp-colorize to colorize my picture. For this procedure i need to get a parameter value (HUE) from the user, which is no problem with SF-VALUE, but i would like to have it like it is in the original menu entry: with a scroll bar and a sample of the color which will be used for colorization. Is it possible to do this with SF-ADJUSTMENT or in any other way?

To ofnuts: Thanks for your previous answer. Actually it did help me a bit. :-)
Find all posts by this user
Quote this message in a reply
May 15, 2011, 21:59
Post: #3
RE: Script-Fu: script does not work properly
(May 15, 2011 16:06)ofnuts Wrote:  Use SF_COLOR and document you only use the Hue.

Ah ok... now i know how the color vector and the hue/saturation/lumination are connected. But is there any easy way to convert the RGB values to HSL values. Perhaps there exists a procedure in gimp or a script on the internet? I really tried to find it out on my own, but i can't find a satisfying answer.

So thank you for your patience, because i know that some questions seem to be stupid, when i look at them now, but i tried my best...
Find all posts by this user
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Scale Image won’t show inches properly pixelated 4 1,992 Sep 18, 2014 18:47
Last Post: Mark Pigott
  Create new images button & Save as override from Script-fu beniman 6 847 Sep 10, 2014 10:10
Last Post: beniman
  Can't get copy and paste to work UlyssesBlue 4 931 Sep 8, 2014 09:43
Last Post: UlyssesBlue
  How to work with anti-aliased shapes Sagemode 2 546 Jul 13, 2014 08:23
Last Post: Sagemode
  pattern fill info doesn't work lvquiet 10 1,117 Jun 5, 2014 06:37
Last Post: lvquiet

Forum Jump:

GIMP ForumPortalArchiveContactTermsRSS