Painter ColorTalk Help Transcription == operands == [red] red refers to the red component of the image. red = x; In this example the red component of the image is replaced with a ramp going from 0 at left to 1 at right. Note that this has no effect on the green and blue components. [green] green refers to the green component of the image. green = 0.5; In this example the green component of the image is replaced with a flat value of 50% green. Note that this has no effect on the red and blue components. [blue] blue refers to the blue component of the image. blue = noise; In this example the blue component of the image is replaced with noise ranging between 0 (no blue) through 1 (100% blue). Note that this has no effect on the red and green components. [mask] mask refers to the mask layer of the image. Note: a zero mask refers to the inside of a selection, a mask with a value of 1 refers to the outside of a selection. mask = blue * (1-green); In this example, the blue component of the image is multiplied by the inverse of the green parameter and stores into the mask. [hue] hue refers to the hue (color) component of the image. Note: hue 0 is blue, and hue wraps around. Hue is undefined at saturation 0 or at a value of 0 or 1. red = 1; green = 0; blue = 0; hue = x; In this example, the color is set up to pure red in the first three statements. The last statement varies hue across the image horizontally, creating a spectrum. [saturation] saturation refers to the saturation (colorfulness) component of the image. Note: a saturation value of 0 signifies pure grayscale. A saturation value of 1 signifies pure color. Saturation is undefined at a value of 0 or 1. saturation =0; Running this example on a color photograph will convert it to grayscale. [value] value refers to the value (brightness) component of the image. A value of 0 signifies the color black. A value of 1 signifies the color white. Note: the spectrum exists at a vlue of 0.5 and saturation of 1. value = 1 - value; Running this example on a color photograph will create a negative look where the hue is preserved. [cyan] cyan refers to the cyan plate of the process-separated image color. Note: process color is represented in CMYK color. cyan += 0.1; In this example, ten percent is added to the cyan plate. [magenta] magenta refers to the magenta plate of the process-separated image color. Note: process color is represented in CMYK color. magenta -=0.2; In this example, twenty percent is subtracted from the magenta plate. [yellow] yellow refers to the yellow plate of the process-separated image color. Note: process color is represented in CMYK color. yellow = sqrt(yellow); In this example, the yellow plate is increased considerably. [black] black refers to the black plate of the process-separated image color. Note: process color is represented in CMYK color. black = 0; in this example, the black plate is dropped. [c_red] c_red when operating on a layer, this refers to the red component of the background image. c_red = lerp(red, c_red, c_mask); In this example, just the red part of the layer is dropped. [c_green] c_green when operating on a layer, this refers to the green component of the background image. c_red *= red; c_green *= green; c_blue *= blue; In this example, the layer is composited using multiply. [c_blue] c_blue when operating on a layer, this refers to the blue component of the background image. c_red -= red; c_green -= green; c_blue -= blue; In this example, the layer is subtracted from the image beneath it. [c_mask] c_mask when operating on a layer, this refers to the mak component of the background image. c_mask = min(c_mask, mask); Here, the mask of a layer is included in the image mask beneath it. Note: 0 mask means "inside". [c_hue] c_hue when operating on a layer, this refers the hue (color) component of the background image. c_hue = hue; Here the hue of the layer is stored into the hue of the image beneath it. [c_saturation] c_saturation when operating on a layer, this refers to the saturation (colorfulness) component of the background image. c_saturation = value; Here the value (brightness) of the layer is stored into the saturation component of the image beneath it. [c_value] c_value when operating on a layer, this refers to the value (brightness) component of the background image. c_value *= value; Here the vaule component of the layer is multiplied into the value (brightness) of the image behind it. [c_cyan] c_cyan when operating on a layer, this refers to the cyan plate of the process-separated background image color. Note: process color is represented in CMYK color. red = c_cyan; green = c_magenta; blue = c_yellow; mask = c_black; When you select all and option-click to float a whole copy of an image, this command lets you separate an image into process color. [c_magenta] c_magenta when operating on a layer, this refers to the cyan plate of the process-separated background image color. Note: process color is represented in CMYK color. c_magenta = 0; When operating on a layer, this sets the magenta component of the image behind the selection to zero. [c_yellow] c_yellow when operating on a layer, this refers to the cyan plate of the process-separated background image color. Note: process color is represented in CMYK color. mask = 0.5 * max(c_cyan, max(c_magenta, c_yellow)); This command computes a 50% GCR black channel for the background image into the layer visibility mask. [c_black] c_black when operating on a layer, this refers to the cyan plate of the process-separated background image color. Note: process color is represented in CMYK color. c_black = 0; This drops away the black plate for the background image behind the layer. [cc_red] cc_red refers to the red component of the current color red = cc_red; green = cc_green; blue = cc_blue; This example fills the selection with the current color. [cc_green] cc_green refers to the green component of the current color [cc_blue] cc_blue refers to the blue component of the current color [cc_mask] cc_mask refers to the mask component of the current color [cc_hue] cc_hue refers to the hue (color) component of the current color [cc_saturation] cc_saturation refers to the saturation (colorfulness) component of the current color [cc_value] cc_value refers to the value (brightness) component of the current color [bc_red] bc_red refers to the red component of the background color red = bc_red; green = bc_green; blue = bc_blue; This example fills the selection with the background color. [bc_green] bc_green refers to the green component of the background color [bc_blue] bc_blue refers to the blue component of the background color [bc_mask] bc_mask refers to the mask component of the background color [bc_hue] bc_hue refers to the hue (color) component of the background color [bc_saturation] bc_saturation refers to the saturation (colorfulness) component of the background color [bc_value] bc_value refers to the value (brightness) component of the background color == operators == [#] # is a placeholder for constants [=] = this is the assignment operator. red = 1; assigns the value 1 into the red component of the image. If the value of the right hand side expression of the assignment is outside the range 0 through 1, it is clipped onto range before storing. [+] + this is the add operator. blue = red + green; adds the red and green components of the image and stores the result into the blue component of the image. [-] - this is the subtract operator. blue = hue - value; subtracts the value component from the hue component of the image and stores the result into the blue component of the image. [*] * this is the multiply operator. red = x * y; multiplies the x and y location fractions of the pixel position within the image and stores the result in the red component of the image. [/] / this is the divide operator. red = red / 2; divides red by 2 and stores the result in the red component of the image. [+=] += this is the add into operator. blue += green; addes the green component of the image into the blue component of the image. [-=] -= this is the subtract from operator. red -= noise; subtracts noise from the red component of the image. [*=] *= this is the multiply into operator. blue *= green; multiplies the green component of the image into the blue component of the image. [/=] /= this is the divide by operator. red /= green; divides the green component of the image into the red component of the image. [;] ; the semicolon is used to end statements in ColorTalk. red = 1; green = 0; In this example, the statements are run sequentially. First the red component of the image is set to 1 (full red) and the the green component of the image is set to 0 (no green). [,] , the comma is used to separate parameters to functions. hue = lerp(x, y, 0.5); In this example, the pixel x and y positions are parameters to the lerp function. Note the use of parentheses to enclose the parameters. [(] ( the begin parenthesis is used to contain nested expressions and to delimit functions. red = (green + blue) /2; In this example, the green component is added to the blue component of the image before being divided by two and then stored into the red component of the image. [)] ) the end parenthesis is used to contain nested expressions and to delimit functions. value = usin(x*2); In this example the parentheses are used to surround the single parameter to the usin function. == functions == [x] x refers to the x position of the pixel within the selection being operated on. An x value of 0 refers to the left side of the selection and a value of 1 refers to the right side of the selection. value = x; When running this example in a white image, a left-to-right ramp from black to white is created. [y] y refers to the y position of the within the selection being operated on. An y value of 0 refers to the top of the selection and a value of 1 refers to the bottom of the selection. hue = y; When running this example in a photograph, a spectrum of colos runs vertically through the image. [noise] noise refers to random noise which varies between 0 and 1. value += noise*0.2 - 0.1; In this example 20 percent noise is added to the lightness of the image, creating a stippled effect. This is hue-protected noise. [xnoise] xnoise refers to random noise which creates vertical stripes which varies between 0 and 1. value = xnoise; This creates vertical random stripes in the image which vary in intensity. [ynoise] ynoise refers to random noise which creates horizontal stripes which varies between 0 and 1. value = step(value + ynoise, 1); This creates horizontal random stripes and thresholds the image, rendering it in a sketchy style. [min] min a function which takes two parameters which return the minium of the two value. value = min(0.1, value); This commands limits the minimum luminance of an image to 0.1. [max] max a function which takes two parameters which returns the maximum of the two values. mask = max(red, max(green, blue)); This command computes the brightest of the red, green, and blue channels (for each pixel) and stores it into the mask. [pow] pow a function which takes two parameters which returns the first parameter to the power of the second parameter. red = pow(red, 0.7); green = pow(green, 0.7); blue = pow(blue, 0.7); This command lightens the image using gamma correction. [log] log a function which takes one parameter which returns the log base e of the first parameter. [exp] exp a function which takes one parameter which returns e to the power of the first parameter. [sin] sin a function which takes one parameter which returns the sine of the first parameter (in radians). [cos] cos a function which takes one parameter which returns the cosine of the first parameter (in radians). [lerp] lerp a function which takes three parameters which uses the third parameter to interpolate between the first and the second parameters. If the third parameter is 0, the value of the first parameter is returned. value = lerp(usin(x), usin(y), 0.5); This command creates a simple halftone cell. [swap] swap a function which takes two parameters which swaps the parameters both parameters must be direct domponent specifiers. [sqrt] sqrt a function which takes one parameter which returns the square root of the first parameter. value = sqrt((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)); This commands creates a circular gradation with black in the center. [usin] usin a function which takes one parameter which return the unit sine. usin(x) = (sin(x / (2*PI)) + 1)/2; This function goes through the entire period in a unit, and returns results on the range 0 through 1. [ucos] ucos a function which takes one parameter which return the unit cosine. ucos(x) = (cos(x / (2*PI)) + 1)/2; This function goes through the entire period in a unit, and returns results on the range 0 through 1. [step] step a function of two parameters. If the first parameter is greater than or equal to the second parameter, then a value of 1 is returned. Otherwise a value of 0 is returned. [atan2] atan2 a function which takes two parameters y and x which calculates the angle defined by the points (on the range -PI through +PI). [uclip] uclip a function which takes one parameter and clips the parameter down to the range 0 through 1. [uatan2] uatan2 a function which takes two parameters y and x which calculates the unit angle defined by the points (on the range 0 through 1). [xfposmap] xfposmap a procedure which is passed a position mapping function for the horizontal position of the data inside the selection. [abs] a function which takes one parameter which returns the absolute value of the first parameter. [grain] refers to the value of the current paper grain at the pixel (varies between 0 and 1). [distance] refers to the distance from the center of the selection to the pixel (ranges from 0 at the center to 1 at the corners). [angle] refers to the angle of the current pixel with respect to the center of the selection. The 3 o'clock position is measured as zero. the value of this variable ranges between 0 and 1. [umod] a function of one parameter which returns the parameter mod 1.0. results are naturally on the range 0 through just less than 1. value = umod(value*4); in this example, the image is turned into 4 bands from black to white. This can be useful in creating wood patterns. == constants == 0 1 2 3 4 0.5 0.333 0.667 0.25 0.75 0.1 0.2 0.3 0.4 0.5 0.7 0.8 0.9 == temps == t1 t2 t3 t4 t5 t6 t7 t8 t9 == Color Talk Equations == [HSV hexcone slice v=0.5] value=0.5;saturation=sqrt((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5));hue=uatan2(y-0.5,x-0.5); [LAB square] red=x;green=y;blue=(1-x)*(1-y); [candy swirl] value=0.667;saturation=1;hue=angle+distance; [circular linear ramp] value=sqrt((x-0.5)*(x-0.5)+(y-0.5)*(y-0.5)); [hue-value gamut map] value=0.5;saturation=1;hue=x;value=1-y; [red green ramp] red=x;green=y;blue=0; [smooth dab] saturation=0;value=1-ucos(min(distance,1)*0.5);