PXL Tool Previous

Chapter 13, Pixel Expressions
CTL Tool

Use the CTL tool to write a color transformation language (CTL) expression to control the resulting appearance of a pixel.

Note: The CTL tool can only perform point operations--see-- Image Processing Algorithm Categories.

The CTL tool uses the same UI as the PXL tool--see PXL Tool UI.

The CTL tool supports every feature of CTL. For a more complete list, refer to the CTL manual: http://ampasctl.sourceforge.net/CtlManual.pdf. The main function of the script will be called for each pixel of the output image.

Before applying a script, several conventions must be respected:

The following is a sample script and procedure that blends two images.

To blend two images:
  1. Connect a CTL tool node into an output node in the Schematic view.

  2. Connect image 1 to the In input of the CTL tool.

  3. Create a second input for the CTL tool by right-clicking on the node and selecting Add input from the menu.

  4. Name the new input Img1 when prompted.

  5. Connect a second image to Img1 input.

  6. Select the CTL tool node and click the Edit button to open the Toxik internal editor.

  7. Type the following script into the editor or copy then paste it in using Ctrl + C and Ctrl + V:

    Show full-size image

    The two images are blended.

    Note: Toxik fully supports the CTL import statement and the CTL_MODULE_PATH environment directory. As such, it can be convenient to structure CTL code in Toxik such that the main() function above is used simply as the entry point that calls other CTL functions defined in separate files that are imported with the import statement.

Previous