Question: Please, I need help Method name: makeGrey Parameter(s): A Picture object. This is the source image. Return value: A new Picture object. Each pixel in
Please, I need help
Method name: makeGrey Parameter(s): A Picture object. This is the source image. Return value: A new Picture object. Each pixel in the returned Picture should have a color that is the grey scale equivalent of the corresponding pixel (the pixel with the same x and y coordinate) in the source image. In general, a grey scale color has different ways of being calculated - you must calculate it by averaging the red, green, and blue values from the pixel in the source image and then setting each of the red, green, and blue components of the pixel in the new image to this grey intensity. Example: A single pixel image with a color (100, 200, 50) would have a grey intensity of (100+200+50)/3 = 116 and the new image would be a single pixel with color (116, 116, 116). An example of what a result might look like is the following (please don't treat this as a reference image as I am unsure of what compression or changes might be applied by Canvas).
Method name: makeNegative Parameter(s): A Picture object. This is the source image. Return value: A new Picture object with the colors changed to a photonegative style. Each pixel in the returned Picture should have a color that is a "negative" of the corresponding pixel (the pixel with the same x and y coordinate) in the source image. You must calculate this by taking each red, green, and blue value in the source and setting it to 255 - each value in the returned image. Example: A single pixel image with a color (100, 200, 50) would make a new image with a single pixel with color (155, 55, 205). An example of what a result might look like is the following (please don't treat this as a reference image as I am unsure of what compression or changes might be applied by Canvas).
Method name: safeColor Parameter(s): A single int value representing one of a red, green, or blue value. Return value: An int that is the same as the parameter, except that it is 0 if the original value is less than zero and it is 255 if the original value is greater than 255. Example: If the parameter is 100, then the return value should be 100. If the parameter is 300, then the return value should be 255.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
