CTL Tool

 
 
 

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

NoteThe 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 except print statements. 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 Composite internal editor.
  7. Type the following script into the editor or copy then paste it in using Ctrl + C (for Windows and Linux) or Cmd + C (for Mac OS) and Ctrl + V (for Windows and Linux) or Cmd + V (for Mac OS):

    The two images are blended.

    NoteComposite fully supports the CTL import statement and the CTL_MODULE_PATH environment variable used to search for CTL programs in a set of directories on disk. As such, it can be convenient to structure CTL code in Composite 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. You may set the CTL_MODULE_PATH in the Tool panel of the Project Preferences panel.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License