CSC 240: Computer Graphics

Lab 1: Checkerboard

  1. Download and
  2. Open up the terminal, run:
    python --version 
    It should be 3.4.3.
  3. Navigate to where you saved and run:
    What commandline arguments does it require?
  4. To create a 400x100 pixel image, run:
    python 400 100 
    What do you get?
  5. In the function make_image, only one pixel is colored. Replace these lines with code that loops over every pixel in the image and colors it using pix_color.
  6. Replace pix_color with a function that colors the pixel "blue" if x is even and "white" if x is odd.
  7. Modify pix_color to make a checkerboard.
BONUS: Make your checkerboard more interesting! Different colors, different block sizes, etc.