CS108 Project 1: The Flower Adder program
Due Friday, April 5, by 9:00 AM
It has become popular to add edited photos of things on social media. As such, we will develop a new program which will quickly become very popular. It is called Flower-Adder, and adds flowers to pictures.
Using Processing, set up a new program with this functionality:
- When the program is opened, a picture is displayed (set the background ot the picture). The program should open a picture called "start.png". The user is responsible for providing such a file in the appropriate location.
- When the left mouse button is clicked, a flower is added to the image. Your program should randomly add one of three flowers, and randomly pick between three different colors. As such, there should be 9 possibilities for what is displayed
- When the right mouse button is clicked, the program should save the image as "better.png".
Saving and Loading Images
For saving and loading images, look at the Processing functions loadImage(filename) and save(filename).
Drawing a Flower
Recall the lab on drawing circles, using sin, cos, and polar coordinates (demo when this is assigned). For a brief explanation of polar coordinates, see https://www.mathsisfun.com/polar-cartesian-coordinates.html. Flowers are often circular in nature, and so using a loop where the iterator is the angle (in radians) will allow easy drawing of circular features. This is just one idea for creation flowers, they can be created in many ways. There is also a tutorial on flowers in processing online.
Checklist for Turn-in
Before turning in your program on Blackboard, check the following:
Left click creates flowers
There are at least 3 types
There are at least 3 colors
Any color is possible with any type, or there are at least 9 combinations in some way
Right click saves the current image
Turning in the Project
Turn in the project on Blackboard. They will be graded in detail, but if you want, I can check and see if it seems ok first.