The p5.js Image is used to do the draw operation on the image. There are some specific attributes to do these kinds of operations and some functions to load or display the image, mentioned below.
p5.js save |
Description |
---|---|
saveCanvas() | This function is used to save a p5.Table object to a file. |
p5.Image |
Description |
---|---|
save() | It is used to save the image to a file by forcing the browser to download it. |
filter() | It is used to apply the filter to the image. |
resize() | It is used to resize the image to the given width and height. |
numFrames() | It is used to return the total number of frames of the GIF animation. |
reset() | It js is used to restart an animated GIF and play it from its beginning state. |
delay() | It is used to change the delay between each frame in a GIF animation. |
mask() | It is used to apply the given mask to the image. |
setFrame() | It is used to set the index of the currently visible frame of the GIF animation. |
getCurrentFrame() | It is used to return the index of the currently shown frame of the GIF animation. |
Loading and Displaying Pixels |
Description |
---|---|
loadImage() | It is used to load an image from the given path and create a p5.Image object with the image. |
tint() | This function is used to set a fill value for images. |
noTint() | It removes the fill value for images that has been previously applied using the tint() function. |
imageMode() | It function is used to set the image mode of an image. |
filter() | It function is used to apply filters to the canvas. |