CSC 240: Computer Graphics

Lab 1: Checkerboard

  1. Download lab1.py and raster.py.
  2. Open up the terminal, run:
    python --version 
    It should be 3.4.3.
  3. Navigate to where you saved lab1.py and run:
    python lab1.py 
    What commandline arguments does it require?
  4. To create a 400x100 pixel image, run:
    python lab1.py 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.