User Tools

Site Tools


Lab 2

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 System.currentTimeMillis 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

3. Grab the code Convert Image to Grayscale from the class wiki and test it out as in #1 using the exact same image.

4. Wrap the function call to grayscale with timing calls as in #2 and output the time it takes for this function to process the array, as well as the average processing time per pixel.

cwh_lab2.txt · Last modified: 2019/09/10 16:13 by chanw0