[imagej] Commandline invert image


min read

My profile

Share this:

For instance from fluorescent images to “normal” images. (FiSH to “normal” images):
works like this: newpixelvalue = 255 – pixelvalue

This works for single layer images as well as RGB images.

[code:1:67f0d6c4e8] /**
* Inverts image, single layer
* @author Ramon Fincken, http://www.ramonfincken.com/permalink/topic243.html
* @param fullpath
* @param write_to_png
public void invert(String fullpath, String write_to_png)
ImagePlus img = IJ.openImage(fullpath);
ImageProcessor IP = img.getProcessor();


IJ.save(img, write_to_png);

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *