Program 1: Image Writer

Due Friday, September 19th


Summary | Instructions | PPM Format | Submission Instructions

Summary and Goal

Create an image in PPM format.

Instructions

  • Write a program in C to output an image to standard out.
  • Image must be 800x600 if the user fails to provide a custom size. It may be a solid color or something more interesting.
  • To test your program, redirect to output to a file and view it with an image viewer. e.g.
    eclipse / IrfanView
  • Once your basic program works add these required features:
    1. Get the width and height of the picture from the user via command line input. Use stderr to describe correct input if none is provided at run time.
    2. Use these values to create a picture in this custom size.

Assignment Credit

If you correctly complete this assignment, your maximum grade is a 95%. However, you may do any or all of the following extra credit options.
  • Turn this assignment in a full 24 hours early (to the minute) to receive an extra 5 points.
  • Be the first to turn in a completely correct assignment to receive an extra 5 points. (second receives 4 points, etc.)
  • Output an image that is patterned in some interesting way (other than solid color) to receive an extra 5 points. Ask about the design if you are not sure if it qualifies.
  • Prompt the user for their favorite RGB triple and use these values in creating at least a portion of the image.

Submission

  • Your C program file should be named writer.c.
  • Hand in writer.c no later than 11:59 p.m. Friday, September 19th.
  • Email writer.c as an attachment to your lab professor. Paste into the subject line CSC 112 Program 1 writer.c
     
    1. source code attachment

    2. subject line: CSC 112 Program 1 writer.c


  • Keep the email submission confirmation for reference later.


Summary | Instructions | PPM Format | Submission Instructions