If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

image(image, x, y, width*, height*)

Draw an image on the canvas. The only allowed images are those that popup in the image picker when you use the getImage() method. The image is positioned using the x/y as the upper left corner. For alternative ways to position images, see imageMode().
Parameters:
NameDescription
imagean image returned by getImage()
xthe x-coordinate of the top left corner
ythe y-coordinate of the top left corner
width(Optional) the width of the drawn image
height(Optional) the height of the drawn image

Want to join the conversation?

No posts yet.