Picture Lab: Activity 3

A3: Exploring a picture
A3-1

Questions

  1. What is the row index for the top left corner of the picture?
  2. What is the column index for the top left corner of the picture?
  3. The width of this picture is 640. What is the right most column index?
  4. The height of this picture is 480. What is the bottom most row index?
  5. Does the row index increase from left to right or top to bottom?
  6. Does the column index increase from left to right or top to bottom?
  7. Set the zoom to 500%. Can you see squares of color? This is called pixelation. Pixelation means displaying a picture so magnified that the individual pixels look like small squares.

Homework:
Picture Lab Activity 3


A3-2

Exercises

  1. Modify the main method in the PictureExplorer class to create and explore a different picture from the images folder.
  2. Add a picture to the images folder and then create and explore that picture in the main method. If the picture is very large (for instance, one from a digital camera), you can scale it using the scale method in the Picture class.
    For example, you can make a new picture (“smallMyPicture.jpg” in the images folder) one-fourth the size of the original (“myPicture.jpg”) using:

    Picture p = new Picture("myPicture.jpg");
    Picture smallP = p.scale(0.25,0.25);
    smallP.write("smallMyPicture.jpg");