Slicing an Image

The last image-related manipulation we will look at involves taking an image, trimming the parts of it you don’t care much about, and taking this smaller image to then display in our canvas. This manipulation is more commonly (and concisely!) known as slicing. The way it works is by using yet another variant of the drawImage method:

Get hands-on with 1200+ tech skills courses.