Before reading this section you should first read about cells.
To display an image on the screen, the image has to be loaded into a cell. You can have up to 26 cells visible at a time, each with a different image in. the image will remain in the cell until something else is loaded into that cell, but you can hide the cell and show it again, or change the cell's location, without having to reload the image.
PsyScript understands any image file formats that your web browser understands. This includes (but is not limited to) GIF, JPEG, PNG, and (for some browsers) TIFF. If your web browser can display the image in a normal static web page, PsyScript will be able to load it into a cell. However, PDF images are not ideally suited to display in this way, and it would be better to convert them into a different format.
The most efficient, most colour-accurate, and least distorted image format is PNG. If you are given a choice about which format to use, use PNG files with names ending in '.png'.
PsyScript correctly supports images with alpha channels if your browser does. If you need to display an irregularly-shaped image against a coloured background, this is how to do it. It is better than trying to find a particular colour that exactly matches the background of a photograph.
The smallest amount of code required to show an image would be …
load commands commands are not only slow, but are unpredictably slow, varying even by a second or two depending on when caches run out of space, when anti-virus software cuts in, and all sorts of other matters. Consequently, do your load operations outside any time-critical parts of your script.
load cell value with image value
Loads the image from a file in the same folder as the script file into a cell
load cell A with image llama.JPG
load cell L with image $varImageFileName
load cell $varTargetCell with image target.png
load cell value with image value from folder value
Loads the image from a file in a subfolder of the script folder into a cell
load cell A with image llama.JPG from folder animals
load cell L with image $varImageFileName from folder female
load cell $varTargetCell with image target.png from folder $varSelectedColour