Question: Please do this in Java. The IMP.java is attached below the instructions. Here is the IMP.java: Start Download Imp. java and create a new project

Please do this in Java.

The IMP.java is attached below the instructions.

Please do this in Java. The IMP.java is attached below the instructions.

Here is the IMP.java: Start Download Imp. java and create a new

project with the stubbed code About the Software Imp is the shell

Here is the IMP.java:

of a image processing application. It will allow you to open an

image, jp or (I think, but don't really remember) .gif file g

Once an image is open it breaks downeach pixel of the image

into first a single dimensional amay, and then converts that into a

2D array of pixels Each pixel in the 2D array, which is

Start Download Imp. java and create a new project with the stubbed code About the Software Imp is the shell of a image processing application. It will allow you to open an image, jp or (I think, but don't really remember) .gif file g Once an image is open it breaks downeach pixel of the image into first a single dimensional amay, and then converts that into a 2D array of pixels Each pixel in the 2D array, which is callcd "pixels in the array is an integer valuc, a large intcgcr valuc that is of no usc to you as just an int. Embedded into each integer value is a one byte value for red, green, blue and a alpha channel (transparency). In order to get the values of a pixel at some random location, let's say X 100, Y 200, you would request an int from the array: int currentPixcl picture[YIDX]: Mnotice Y is first, Y is the height of the image, X is the width. Then in order to breakdown that pixel to it's red, green, blue, alpha channel you need to set up an amay and send that int to getPixelArray method like this int rgbArrayn new intl4 rgbo Amay getPixelArray (currentPixel) Now the rgbArray has the value for Red in rgbArray[1, Green in rgbArray[2], and Blue in rgbAmay 121. rgbAmayIOI is transparency, don't mess with this for now. it should always come back as 255. If you switch it o 0 your pixel becomes transparent Here is how the integer gets broken down to 4 bytes, it's bit twiddling private int O getPixelArray (int pixel) int templ new int 4] templ0] (pixel, 24) & 0xff. pixel 16) & 0xff emp temp12] (pixel 8) & 0xff; empl3 (pixel & 0xff. return temp Then you get a rgbArray back from this method, do tests, manipulate based on values, and when you're ready to put it back to an int you can put back into an array that can be drawn to the screen you call this method private int getPixels (int rgbu) int alpha 0. 24 (rgbli

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!