How to increase/decrease brightness of an image with the use of JSlider slider or JScrollBar
ashish donvir
Greenhorn
Joined: Mar 01, 2012
Posts: 25
posted
0
i Had load my image Buffered image now need to brighten it using Slider or scroll-bar so could any one suggest me how to do it? If it can done using any ImageJ library then suggest me that also.
OK I will try something for sure but right now first i am trying to plot histogram of an image so suggest me that how could i plot my histogram in a JPanel or content pane.
I got the the histogram using Jai now need to plot it somehow
Here is how i am getting my histogram
PlanarImage image = JAI.create("fileload", "C:\\Sunset.jpg");
ParameterBlock pb = new ParameterBlock();
pb.addSource(image);
pb.add(null); // The ROI.
pb.add(1); // Samplings.
pb.add(1);
pb.add(new int[]{256}); // Num. bins.
pb.add(new double[]{0}); // Min value to be considered.
pb.add(new double[]{256}); // Max value to be considered.
// Creates the histogram.
PlanarImage temp = JAI.create("histogram", pb);
Histogram h = (Histogram)temp.getProperty("histogram");
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
> how could i plot my histogram in a JPanel or content pane.
tried google?
ashish donvir
Greenhorn
Joined: Mar 01, 2012
Posts: 25
posted
0
Yes Michael, I can plot it using ImajeJ library but the thing is i need to have my own histogram so that i can be helpful to me in my further image processing
so suggest me some way to plot it
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
> so suggest me some way to plot it
I did.
unless you're the only person to have ever wanted to plot a histogram in java,
there should be heaps of sample code out there.
grab some of the code, modify to suit, then, if you have problems,
you can post the code you've tried.
if you're waiting for someone to write it for you, there's rent-a-coder for that