Page 1 of 1

Using Formulas with more than one image

Posted: 23 May 2024, 13:56
by nmac
Hi!

is there a way to use formulas in scripts using not only the active image but several open images and for each color channels of those images?
As an example using 2 RGB images and combine both red (vr1+vr2) channels of each image and generate a new mono image with the result. I know this
can be obtained using the Arithmetic/Add/Merge menu but sometimes it would be useful and faster using scripts for sucessive and combined operations.
You can think this as scripted pixelmath.

Thanks

Re: Using Formulas with more than one image

Posted: 24 May 2024, 17:20
by fabdev
Hi, using a Formula it's not possible, but it could be possible with other commands.
For example, the task you wrote can be done with:

1) For DSLR and OSC, with an in-memory Preprocessing, selecting "Red channel" as method in "RGB Demosaic".
2) For generic color images, with a script which extracts the Red channel (creating a new image) then selecting the other image, extracting again the Red channel and then adding the two images. To change the active image see the script commands: ImageList.Select ....
Fabio.