Image Script
·
What is Image Script?
Image script is a program that allows users to manipulate images exactly the way they want. Image Script is NOT a scripting language. Rendition Script is the language that powers this program. Image Script is just one of many applications of Rendition Script. For more information or to learn about the Rendition Script language, visit www.companyname.com. This help file assumes you have a reasonable level of knowledge about Rendition Script. If you don’t know anything about it, visit the link. It is a very simple but powerful language to learn.
·
Why use Image Script?
With Image Script, the user has complete control as to how every color channel of every pixel is manipulated. There are unlimited ways to use this program. Here are a few examples:
·
How an image is stored and displayed on a
computer
In order to use Image Script, you must have a good understanding of how an image is stored and displayed on a computer. Every image is composed of pixels (picture elements). The number of pixels depends on the size (resolution) of the image. An image with a resolution of 10 x 10 has 100 pixels. An image with a resolution of 100 x 100 has 10,000 pixels. Now, every pixel has three pieces (bytes) of information – red intensity, green intensity, and blue intensity. These pieces of information are what Image Script manipulates. Each intensity can range from 0 to 255. By combining these intensities, a computer can display over 16 million colors.
Here are some examples of pixels magnified by 1600%:
Red: 255 Green: 0 Blue: 0
![]()
Red: 0 Green: 0 Blue: 255
![]()
Red: 0 Green: 255 Blue: 0
![]()
Red: 225 Green: 230 Blue: 25
![]()
Red: 230 Green: 25 Blue: 200
![]()
·
How to use Image Script to manipulate an
image
In the Image Script Editor window, there are five tabs:
Tabs 1 – 3:
The first three tabs contain the scripts that will manipulate each color channel of an image. The default script for all three tabs (color channels) is “move input, output”. This will simply leave the image unchanged. The top section contains dynamic help for the Rendition Script language. The dynamic help changes based on where your cursor is positioned in the script. It can also show information based on an instruction you choose from the “Display Info” list.
Tab 4:
This tab is a visual way to include variables in any (or all) of your scripts. Click the “New Variable” button to create a new variable. The name is what you will refer to this variable by in your script(s). If you want to remove any variables, select all that you want to remove and click the “Remove Variable” button. The “Change” button will change the description of the selected variable to the text you have entered. The “Set” button will change the value of the selected variable to the number you have entered. The “Set and Transform” button will change the value of the selected variable to the number you have entered and then transform the image to see the immediate affect of the newly changed variable.
Tab 5:
The last tab controls the way values outside the valid range of a byte (0-255) will be evaluated. For example, if you have a script such as “add input, 50, output”, and the input value is 230, the result is 280. Should this value be clamped to 255, or should it cycle back to 25? The clamp method is used the most, but you may want to use the cycle method if you are procedurally creating an image or if you are creating an encoding / decoding algorithm of some sort. Also note that the cycle method is the faster of the two methods. See the tab for more information and examples.
·
How Rendition Script organizes image
information
For now, we will concentrate on only one color channel but the concept is exactly the same for all color channels. First of all, the intensity of the original color is represented by the “input” constant. The new intensity is assigned by the “output” variable. For example, if you were editing the red color channel, and you wanted the intensity for all pixels to be the highest possible, your script would look like this: “move 255, output”. If you wanted there to be no red in the image, your script would look like this: “move 0, output”. To slightly increase the red color of the image, you could write a script like this: “add input, 30, output”. To increase the contrast of an image, you could apply the following script to all color channels: “pow input, 1.05, output”. The best way to learn how Rendition Script transforms images is to view the sample workspaces and experiment with different values and / or instructions.
·
Image Targets
Image targets are simply windows that contain an image that is ready to be transformed. To add a new image target, use the main menu and select “Window->New Target Image”. You can also use the shortcut of “Ctrl + T”. To select an image target, select a target from the list next to the “Transform Target Image” button on the Image Script Editor window. It is important to note that when you transform an image target, you are transforming the image that was originally loaded into the target or the image that was loaded using the “Load Image” button in the toolbar. This is not necessarily the image that is currently being displayed. Use the arrow buttons to switch between the original image and the transformed image.
NOTE: When you open the Image Script application, there is already one default image target.
·
Saving / Loading scripts and workspaces
To save / load a script you can use the main menu and select which script you want to save / load or you can use the toolbar above the script box. When you save a script, you must remember you are only saving the script of one color channel. To save all scripts, variables, and settings, you must save the workspace. To save / load a workspace, use the appropriate option from the “File” menu.