Login  Register

Re: Custom brightness & contrast on a image

Posted by Herbie on Oct 10, 2016; 3:58pm
URL: http://imagej.273.s1.nabble.com/Custom-brightness-contrast-on-a-image-tp5017336p5017340.html

well Danae,

you may use the Recorder-functionality of ImageJ to get an idea of the
relevant Java calls. Don't forget to select "Java" in the recorder.

Here is what I get for example when I change the contrast of an 8bit
ramp image:

//////////////////////////////////
import ij.*;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.*;

public class My_Plugin implements PlugIn {

        public void run(String arg) {
                ImagePlus imp = IJ.getImage();
                IJ.setMinAndMax(imp, 73, 181);
        }
}
//////////////////////////////////

Besides, you should have an idea of how you define contrast. There are
at least three different and common ways of doing so. Furthermore, you
must consider whether you want to deal with different image types (RGB,
gray 8bit, 16bit, 32bit)...

Good luck

Herbie

:::::::::::::::::::::::::::::::::::
Am 10.10.16 um 17:43 schrieb Danae:

> Good day Herbie!
>
> I'm just learning how to program plugins for ImageJ in JAVA with Eclipse
> from the simplest things to other more complicated, in order to help
> improving plugins and help new developers in the future.
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Custom-brightness-contrast-on-a-image-tp5017336p5017339.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html