Question: In java Write a program that takes the name of a grayscale image file as a command line argument and uses StdDraw to plot a

In java Write a program that takes the name of a grayscale image file as a command line argument and uses StdDraw to plot a histogram of the frequency of occurance of each of the 256 grayscale intensities. Here is a link to draw https://introcs.cs.princeton.edu/java/stdlib/ And I also posted Luminance.java that converts to grayscale. Please explain to me how the program takes an image file as an argument. Also if you use imports tell me where to find info on them if you can.

In java Write a program that takes the name of a grayscale

13 14 import java.awt.Color; 15 16 public class Luminance { I return the monochrome luminance of given color @Deprecated public static double lum(Color color) 20 21 return intensity (color) 23 I return the monochrome luminance of given color public static double intensity (Color color) 25 27 28 29 int r color. get Red(); int g = color. getGreen(); int b color. get Blue(); return 0.299*r 0.587 g.114 b; 31 Ireturn a gray version of this Color public static Color toGray (Color color) f 32 int y (int) (Math, round (1um(color ))); Color gray new Color(y, y, y); return gray 34 // round to nearest int 35 37 /I are the two colors compatible? public static boolean areCompatible(Color a, Color b) f 39 40 return Math.abs(intensity (a) - intensity(b))128.0; /Itest client public static void main(String[] args) int [ ] a = new int [6]; for (int i 0; i

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!