User Tools

Site Tools


CS 276 Lab #1

The purpose of this lab is to get used to working with the basic patterns of image processing algorithms and measure the performance of the image processing code run in the Processing development environment (and review programming concepts).

Warm-up Questions.

  • How can we determine how long it takes to execute a function call?
  • How can we determine how long it takes to process just one pixel?
  • What is the effect if draw() function runs continuously when processing an image pixel-by-pixel? Does it help, hurt, or not matter?


  1. Copy the code Invert Image from the class wiki to the Processing IDE.  Use Sketch -> Add File... to import your own image file.  Modify the loadImage function to use your new image file.  Run to test that it works.

  2. Wrap the function call to negativize with calls to the Processing function millis() so that you can measure the amount of time, in milliseconds, that negativize takes to process the pixels array.  Output the results of the measurement using println. Also output the average processing time per pixel by dividing the total time by the number of pixels in your image.

cs276/spc.lab1.txt · Last modified: 2019/09/10 21:35 by scarl