Macro Language Question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Macro Language Question

HarryU
Hello there,

I'm new to using imageJ, and am trying to see what I can do in the macro language.

I want to create a simple image with pixels set to black and white in a chequered or chessboard pattern, but I'm struggling to find a command that expresses what I want to do.

My approach is to set up two for loops, one inside the other, to scroll through rows and columns. Inside the inner for loop I want to put an if/else statement that makes a pixel back if the column and row values are both odd or both even and white if it is a combination of even/odd column and row values.

My current attempt is below, but the (i == odd) etc commands don't work.

I'm also not 100% sure the else if statements are done correctly.

TL;DR

Is there a command similar to "if (i is odd)"

Thanks,

Harry