On 18 May 2001, at 16:16, Raphael Quinet wrote: > On Fri, 18 May 2001, "Branko Collin" <collin@xxxxxxxxx> wrote: > [...] > > My question is: when is a reworking of a script good enough to be > > included in the distribution? Is there some kind of policy for this? > > Well, if you add some features that can generally be considered useful > and you do not remove existing features (breaking APIs), then you > should definitely submit a patch so that the updated script can be > included in a future release of the Gimp. Of course it is debatable as to what can generally be considered useful, but then I figure I can let you guys (and gals) decide... An added problem may be that the original author (Federico Mena Quintero) copyrighted the script without any license. Does that mean it is automatically GPL'ed, because the script is part of the standard GIMP distribution? I do not know if the law works that way. As you can see, I worked with IF statements rather than the Scheme version of a CASE statement, because I could not get the latter to work. The use of the changes: achieving a more realistic interlace effect. By giving brightness a negative value, you can get the effect of the scanline 'slowly' fading to darkness. Here's an example of that effect: <http://www.planetarion.com>. To do: graying out the brightness/contrast value if Type != Brightness and Type != Contrast. Can anyone tell me how to do this? Following is the unified diff of erase-rows.scm and my version of that script. I changed a lot, but the script is not that long. --- scripts\old-erase-rows.scm Mon Dec 25 20:01:50 2000 +++ _gimp1.2.Branko Collin\scripts\erase-rows.scm Sat May 19 18:00:26 2001 @@ -1,4 +1,4 @@ -(define (script-fu-erase-rows img drawable orientation which type) +(define (script-fu-erase-rows img drawable orientation which type rwidth bcvalue) (let* ((width (car (gimp-drawable-width drawable))) (height (car (gimp-drawable-height drawable)))) (gimp-undo-push-group-start img) @@ -6,12 +6,13 @@ (if (< i max) (begin (if (= orientation 0) - (gimp-rect-select img 0 i width 1 REPLACE FALSE 0) - (gimp-rect-select img i 0 1 height REPLACE FALSE 0)) - (if (= type 0) - (gimp-edit-clear drawable) - (gimp-edit-fill drawable BG-IMAGE-FILL)) - (loop (+ i 2) max)))))) + (gimp-rect-select img 0 i width rwidth REPLACE FALSE 0) + (gimp-rect-select img i 0 rwidth height REPLACE FALSE 0)) + (if (= type 0) (gimp-edit-clear drawable)) + (if (= type 1) (gimp-edit-fill drawable BG-IMAGE-FILL)) + (if (= type 2) (gimp-brightness-contrast drawable bcvalue 0)) + (if (= type 3) (gimp-brightness-contrast drawable 0 bcvalue)) + (loop (+ i (* 2 rwidth)) max)))))) (loop (if (= which 0) 0 1) @@ -23,15 +24,18 @@ (gimp-displays-flush))) (script-fu-register "script-fu-erase-rows" - _"<Image>/Script-Fu/Alchemy/Erase every other Row..." - "Erase every other row/column with the background color" - "Federico Mena Quintero" - "Federico Mena Quintero" - "June 1997" + _"<Image>/Script-Fu/Alchemy/Draw Rows or Cols..." + "Draw rows/columns in background color or by adjusting brightness/contrast." + "Federico Mena Quintero/Branko Collin" + "Federico Mena Quintero/Branko Collin" + "June 1997/May 2001" "RGB* GRAY* INDEXED*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-OPTION _"Rows/Cols" '(_"Rows" _"Columns") SF-OPTION _"Even/Odd" '(_"Even" _"Odd") - SF-OPTION _"Erase/Fill" '(_"Erase" _"Fill with BG")) + SF-OPTION _"Type" '(_"Erase" _"Fill with BG" _"Brightness" _"Contrast") + SF-ADJUSTMENT _"Width of Row/Col" '(1 1 8 1 10 0 1) + SF-ADJUSTMENT _"Value of Brightn./Contr." '(0 -127 127 1 10 0 1)) + -- branko collin collin@xxxxxxxxx