Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please, I need help. Create a new project. Add a package imageloop, and a class pictures to that package. Method name: makeGrey Parameter(s): A Picture

Please, I need help.

Create a new project. Add a package imageloop, and a class pictures to that package.

  1. 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).
  2. 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).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions