Draw |
Adjust |
When you click Run, the code in the upper left will be run for each pixel in the image. W and H refer to the width and height of the image. X and Y refer to the location of the current pixel. R, G, and B refer to the color of the current pixel being drawn. getR, getG, and getB are functions that take in an X and Y value, and refer to the color value of the original pixel at that location. For example, getR(10,20) refers to the red value of the pixel at X=10,Y=20 in the original image. Available math operations: + Add - Subtract * Multiply / Divide % Remainder (x%y means remainder from x/y) && And || Or ! Not < Less than <= Less then or equal >= Greater than or equal > Greater than Math.sqrt(x) square root of x Math.abs(x) absolute value of x Math.random() random number between 0 and 1 For more math functions, click here. |