Question: Convert to Grayscale public void grayscaleWithLuminance ( ) Pixel [ ] pixelArray = this getPixels ( ) ; Pixel pixel = null; int luminance 0
Convert to Grayscale
public void grayscaleWithLuminance
Pixel pixelArray this getPixels;
Pixel pixel null;
int luminance ;
double redValue ;
double greenValue ;
double blueValue ;
for int i; i pixelArray.length; i
pixel pixelArrayi;
compute the intensity of the pixel average value
luminance intredValue greenValue blueValue; pixel.setColornew Colorluminanceluminance.luminance;
explain the code kinfldly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
