Login  Register

Re: Anaglyph Macro Speedup

Posted by Gabriel Landini on May 06, 2008; 7:28am
URL: http://imagej.273.s1.nabble.com/Anaglyph-Macro-Speedup-tp3696335p3696337.html

On Monday 05 May 2008 23:32:25 Albert Cardona wrote:
> > But I would like to know: Is there any way to speed up this sort of
> > macro: one that does pixel by pixel operations on two images and then
> > writes the result to a third image.  I have tried to speed it up, but
> > it is very slow on a large image.
>
> The macro language uses strings as internal data representation, so no,
> you can't speed up pixel by pixel operations.

Ah,  but you could split the image in RGB planes and operate on those instead
of going pixel by pixel.
You have 2 images with r0, g0, b0 and r1, g1, b1. Your macro (if I am not
mistaken, I have not run it) creates a new image which is  r0,g1,b1.

I would split both images into  R, G, B planes and then merge R0, G1, B1
planes into a new RGB image. This is done by 2 plugin commands
"Image>Color>RGB Split" and "RGB Merge" which called from a macro would be way
faster.

Cheers,

G.