CS 111 - Program Design I

Project 2 - Image Authentication

Due Date: Thursday 3/15/2018 at 11:59 pm

For this assignment, we will be doing image authentication. The idea is that we are checking to see if a copy of a picture has been modified away from the original picture.

We will be using three pictures for this project. The first picture will be the original. The second picture will be the copy that is being checked for modifications. The third picture will be created by the program which will show only the parts of the original that were modified in the copy. The user is to prompt the user for the original and the copy (using pickAFile() twice is the suggested way to prompt the user for these two pictures).

The two pictures must have the same width and height. If the two pictures do not have the same size, print out an error message and quit the program. The third pictures is to be created to have the same width and height.

For each pixel position in the first picture, compare the color of that pixel with the color of the pixel in the same position from second picture. If the two pixels have the same color (i.e. the original is not modified in the copy), set the color of this position in the third picture to blue. If the two pixels do not have the same color, set the color of this position in the third picture to the color of the pixel from the original picture. The "color distance" function is to be used to determine if the color of the pixels is "the same". Not that due to the way that pictures are stored, the program should allow some small difference between the color of the pixels but still consider the colors to be "the same".

After all the positions have been checked and the third picture has been completely created, the third picture is to be displayed and the user should be asked to provide a filename to save the third picture. Again, pickAFile() should be used for the prompting of the filename.

Note: if the color in the original picture at a modified position is blue or nearly blue, it may be hard to detect the modified parts. Since most of our original pictures are in black and white, using the color blue does make the modified areas of the picture standout.

The following are original pictures and modified pictures. It will be assumed that everyone will be using the following picture to run/test their programs. You do not need to find/create your own pictures for this assignment (however, if you want to, you certainly can. Creating such picture is actually kind of hard to do). The picture of the Lady, the picture of the Houses, and the picture of the butterfly work best for this assignment.

Look here for results of this program.

Note: the results that you get are not going to be as good as you would like. This is because the .jpg format use a "lossly" compression algorithm. This algorithm introduces some inaccuracies in order to get a better compression result. So instead of asking "Do these two pixels have the same color?" We have to ask "Are the colors in these two pixels close enough?"

Project Collaboration

You are allowed to receive help on this project from other students who are also taking CS 111. Each student must still complete and submit his/her own project. You will be required to include a Collaboration Statement somewhere on your project if you receive help. This statement can simply be something like the following:

For this project, I received help from the following member of CS 111.
  • Devang Jariwala, netID: djariw1
  • Shun Liang, netID: sliang2
  • Hongwei Zhu, netID: hzhu7

This statement should list each helping student's name in a comment in the "header comment" of your Java file that includes the main() method.

Programming Style

Your program must be written in good programming style which includes:

  • Meaningful Variable Names
  • Proper Indentation of Code
  • Blank Lines between Code Sections
  • Use of Multiple Functions
  • In-Line Commenting
  • Header Comment for the File
  • Header Comments for each Method.

How assignments should be submitted

You are also to submit the Python file electronically via the Assignment link in Blackboard for this lab. You are to name your file with the lab number and your netID. Unless you have created your own pictures to use with this program, there is no reason to send us pictures.

Topic revision: r3 - 2018-04-17 - 20:19:23 - Main.troy
Copyright 2016 The Board of Trustees
of the University of Illinois.webmaster@cs.uic.edu
Helping Women Faculty Advance
Funded by NSF