Examples Image Drop

Image Drop

drop() is a p5.js element method that registers a callback every time a file is loaded into the element. The uploaded file is created into a p5.File class. You can use the drop() callback to check the file type, then write conditional statements responding to the file type.

Image Drop: Revised by Kasey Lichtlyter. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: 2023 code, pre-2023 code. You can suggest improvements by contributing to the current website!