Question: Using the Picture class from Worked Example 6.2, apply a sunset effect to a picture, increasing the red value of each pixel by 30 percent
Using the Picture class from Worked Example 6.2, apply a sunset effect to a picture, increasing the red value of each pixel by 30 percent (up to a maximum of 255).
Data from worked example 6.2.





WORKED EXAMPLE 6.2 Manipulating the Pixels in an Image A digital image is made up of pixels. Each pixel is a tiny square of a given color. In this Worked Example, we will use a class Picture that has meth- ods for loading an image and accessing its pixels. Problem Statement Your task is to convert an image into its negative: turning white to black, cyan to red, and so on. The result is a negative image of the kind that old-fashioned film cameras used to produce. Cay Horstmann.
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
Based on the provided information from Worked Example 62 and the task you intend to perform you need to modify the code to increase the red value of e... View full answer
Get step-by-step solutions from verified subject matter experts
