Examples of convertToByte()


Examples of ij.process.ImageProcessor.convertToByte()

    if (ip instanceof ColorProcessor) {
      ip = reduceColors(ip);
      img.setProcessor(null, ip);
    } else if ((ip instanceof ShortProcessor)
        || (ip instanceof FloatProcessor)) {
      ip = ip.convertToByte(true);
      img.setProcessor(null, ip);
    }
    new FileSaver(img).saveAsTiff(path);
  }
View Full Code Here

Examples of ij.process.ImageProcessor.convertToByte()

   
    void saveAs8bitTiff(ImagePlus img, String path) {
        ImageProcessor ip = img.getProcessor();
        if (ip instanceof ColorProcessor) {
            ip = reduceColors(ip); img.setProcessor(null, ip);} else if ((ip instanceof ShortProcessor) || (ip instanceof FloatProcessor)) {
            ip = ip.convertToByte(true); img.setProcessor(null, ip);}
        new FileSaver(img).saveAsTiff(path);
    }
   
    /*****************************************************************************
     * method : reduceColors, reduces the color range for the appropriate format *
 
View Full Code Here

Examples of ij.process.ImageProcessor.convertToByte()

    */
    void Process8bitCLT(ImagePlus image){
           colorDepth = 8;
            //setTransparent(false);
            ImageProcessor ip = image.getProcessor();
            ip = ip.convertToByte(true);      
            ColorModel cm = ip.getColorModel();
            indexedPixels = (byte[])(ip.getPixels());
            IndexColorModel m = (IndexColorModel)cm;
            int mapSize = m.getMapSize();
            if (transIndex>=mapSize) {
View Full Code Here

Examples of ij.process.MedianCut.convertToByte()

                ip = ip.convertToRGB();
            }
            MedianCut mc =
                    new MedianCut((int[]) ip.getPixels(), ip.getWidth(), ip
                            .getHeight());
            ip = mc.convertToByte(256);
            ImagePlus imp = new ImagePlus("temp", ip);
            FileInfo fi = imp.getFileInfo();
            byte pixels[] = (byte[]) imp.getProcessor().getPixels();
            GifEncoder ge =
                    new GifEncoder(fi.width,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.