Re: [Gimp-user] Re: RGB to BGR script works, but how to run autolevels?

2003-09-02 Thread Sven Neumann
Hi,

Walter Francis [EMAIL PROTECTED] writes:

 I might very well file a bug asking for an auto levels script-fu, I'm
 just really surprized there isn't something available already!  And
 yes, I've definately been browsing/searching for stuff, otherwise I'd
 have gotten stuck and not gotten anything done.

There is a bug-report already and it even has a patch attached to it:

  http://bugzilla.gnome.org/show_bug.cgi?id=119233


Sven
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: RGB to BGR script works, but how to run autolevels?

2003-09-02 Thread Sven Neumann
Hi,

Sven Neumann [EMAIL PROTECTED] writes:

 There is a bug-report already and it even has a patch attached to it:
 
   http://bugzilla.gnome.org/show_bug.cgi?id=119233

I have now applied this patch to CVS so gimp = 1.3.20 should provide
the functionality you need to finish your script.


Sven

___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: RGB to BGR script works, but how to run autolevels?

2003-09-01 Thread Joao S. O. Bueno
On Saturday 30 August 2003 4:21 pm, Guillermo S. Romero / Familia 
Romero wrote:
 [EMAIL PROTECTED] (2003-08-30 at 1406.58 -0400):
  I also run auto levels on the images when I'm done, but so far it
  looks like this is not possible from Script-fu.  Any updates on
  there?  At least now I just push two buttons instead of
  decompose, compose, pick images, etc.

 Always use the DB browser to search for things while coding, it is
 a great help. You can find other interesting filters there, but I
 think none is exactly what autolevels does. You could even try to
 do something with histogram, but that would mean some kind of long
 loop to analysis all the data.

 If unable to find something that solves your problem, you should
 fill a bug, asking for an enhancement (levels should register a
 PDB call for auto mode or whichever useful description you can
 give).

I coded it to almost working  and sent to Shawn, said it worked, Bbut 
I do not know if he uploaded it to Bug 199233, Guilhermo.  I 
will`just look for it there, wait a second. Yup...the patch is 
there...untested and untouched by those with the appropriate access 
rights... 
http://bugzilla.gnome.org/show_bug.cgi?id=119233

Could someone please do the honors?  :-)


  (set! new-image-red (car (plug-in-decompose 1 inImage inLayer
  Red))) (set! new-image-green (car (plug-in-decompose 1 inImage
  inLayer Green))) (set! new-image-blue (car (plug-in-decompose 1
  inImage inLayer Blue)))

 Why not call only one time and work with the list? car gives you
 the first element, but you can use cadr for the second, and caddr
 for the third. Try typing (caddr '(1 2 3 4)) and (cadr '(1 2 3 4))
 in the Script Fu console to experiment (btw, arrow keys let you
 edit old commands).

 GSR

 ___
 Gimp-user mailing list
 [EMAIL PROTECTED]
 http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user





___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: RGB to BGR script works, but how to run autolevels?

2003-09-01 Thread Walter Francis
I have it down to the following (although I'd still love an autolevels ;-), 
is there any way to pass a list to gimp-image-delete, because I've tried 
several things and I always get invalid argument.  I tried:

(g-i-d new-image-rgb)
(g-i-d (new-image-rgb))
(g-i-d '(new-image-rgb))
Must be something I am misunderstanding about lists.  Basically trying to 
slim the three g-i-d's down to one statement.  But I did reduce the 
decompose to one statement with lists (I suspect it's much faster now but I 
haven't really timed it) and removed some cruft from the script I started 
from that I didn't need..

(define (script-fu-irchannelswap inImage inLayer)

(set! new-image-rgb (plug-in-decompose 1 inImage inLayer RGB))
(set! new-image-bgr (car (plug-in-compose 1 (caddr new-image-rgb) inLayer 
(cadr new-image-rgb) (car new-image-rgb) (car new-image-rgb) RGB)))
(gimp-display-new new-image-bgr)
(gimp-image-delete (car new-image-rgb))
(gimp-image-delete (cadr new-image-rgb))
(gimp-image-delete (caddr new-image-rgb))
(gimp-image-set-filename new-image-bgr (car (gimp-image-get-filename 
inImage))) )
(gimp-displays-flush)

(script-fu-register script-fu-irchannelswap
Image/Script-Fu/Enhance/IR Channel Swap Channel Swap
Walter Francis copyright 2003, Walter Francis
2003-08-30 
SF-IMAGE The Image 0 SF-DRAWABLE The Layer 0 )
--
Walter Francis
http://theblackmoor.net  Powered by Red Hat Linux 9
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user


Re: [Gimp-user] Re: RGB to BGR script works, but how to run autolevels?

2003-08-31 Thread Walter Francis
Guillermo S. Romero / Familia Romero wrote:
[EMAIL PROTECTED] (2003-08-30 at 1406.58 -0400):

I also run auto levels on the images when I'm done, but so far it looks like this
is not possible from Script-fu.  Any updates on there?  At least now I just push
two buttons instead of decompose, compose, pick images, etc.  


Always use the DB browser to search for things while coding, it is a
great help. You can find other interesting filters there, but I think
none is exactly what autolevels does. You could even try to do
something with histogram, but that would mean some kind of long loop
to analysis all the data.
If unable to find something that solves your problem, you should fill
a bug, asking for an enhancement (levels should register a PDB call
for auto mode or whichever useful description you can give).
 

(set! new-image-red (car (plug-in-decompose 1 inImage inLayer Red)))
(set! new-image-green (car (plug-in-decompose 1 inImage inLayer Green)))
(set! new-image-blue (car (plug-in-decompose 1 inImage inLayer Blue)))


Why not call only one time and work with the list? car gives you the
first element, but you can use cadr for the second, and caddr for the
third. Try typing (caddr '(1 2 3 4)) and (cadr '(1 2 3 4)) in the
Script Fu console to experiment (btw, arrow keys let you edit old
commands).
I figured there was a better way, but this is my first one, so I was doing 
what was obvious (and simple :)

I made one other small change, grabbing the filename so the path and 
filename was right to save the changed picture, and I experimented with a 
progress bar but it didn't work quite right..  I'll experiment some more 
with all that, and might try using a list for the above.  I tried RGB once 
but only got the Red, so that's why I split 'em up, a list would be more 
effecient.

I might very well file a bug asking for an auto levels script-fu, I'm just 
really surprized there isn't something available already!  And yes, I've 
definately been browsing/searching for stuff, otherwise I'd have gotten 
stuck and not gotten anything done.

Thanks!

--
Walter Francis
http://theblackmoor.net  Powered by Red Hat Linux 9
___
Gimp-user mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-user