You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a "@pjs preload" directive to preload images before your sketch starts. You can easily add one with the "Playback Settings" tool in the "JavaScript" menu.
]]></description></js_mode -->
<description><![CDATA[
Datatype for storing images. Processing can display <b>.gif</b>, <b>.jpg</b>, <b>.tga</b>, and <b>.png</b> images. Images may be displayed in 2D and 3D space. Before an image is used, it must be loaded with the <b>loadImage()</b> function. The <b>PImage</b> class contains fields for the <b>width</b> and <b>height</b> of the image, as well as an array called <b>pixels</b> that contains the values for every pixel in the image. The methods described below allow easy access to the image's pixels and alpha channel and simplify the process of compositing.<br/>
<br/>
Before using the <b>pixels</b> array, be sure to use the <b>loadPixels()</b> method on the image to make sure that the pixel data is properly loaded.<br/>
<br/>
To create a new image, use the <b>createImage()</b> function. Do not instantiate the object directly with the syntax <b>PImage()</b>.