Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
changing active layers
#1
Hello all. I just got into gimp and also have very little knowledge in scripting.

I have 2 black and white files with little difference.
I want to compare them using gimp.
For the process, I import the 2 files in different layers.
Then, using color exchange, I change the black to blue in one layer.
Then change black to red in the other layer. 
The blending for the second layer will be multiply.

My script below gets an error when setting the second layer active I think.

(define (script-fu-set-active-layers image layer)
  (let* (
    (layer-list (gimp-image-get-layers image))
    (layer1 (car layer-list))
    (layer2 (cadr layer-list))
  )
    (gimp-image-set-active-layer image layer1)
    (plug-in-exchange RUN-NONINTERACTIVE image layer 0 0 0 255 0 0 0 0 0)
    (gimp-image-set-active-layer image layer2)
    (plug-in-exchange RUN-NONINTERACTIVE image layer 0 0 0 0 0 255 0 0 0)
  )
  (gimp-displays-flush)
)

Thank you very much.
Reply


Messages In This Thread
changing active layers - by salamander017 - 01-29-2023, 06:54 AM
RE: changing active layers - by programmer_ceds - 01-29-2023, 10:57 AM
RE: changing active layers - by salamander017 - 01-29-2023, 12:47 PM
RE: changing active layers - by programmer_ceds - 01-29-2023, 05:25 PM
RE: changing active layers - by salamander017 - 01-30-2023, 01:35 PM
RE: changing active layers - by Ofnuts - 01-31-2023, 11:25 AM
RE: changing active layers - by salamander017 - 02-01-2023, 09:35 AM
RE: changing active layers - by programmer_ceds - 02-01-2023, 09:54 AM
RE: changing active layers - by salamander017 - 02-01-2023, 10:40 AM
RE: changing active layers - by Ofnuts - 01-29-2023, 09:10 PM

Forum Jump: