Package ij.process

Examples of ij.process.MedianCut


  /***************************************************************************
   * method : reduceColors, reduces the color range for the appropriate format *
   **************************************************************************/

  ImageProcessor reduceColors(ImageProcessor ip) {
    MedianCut mc = new MedianCut((int[]) ip.getPixels(), ip.getWidth(), ip
        .getHeight());
    Image img = mc.convert(256);
    return (new ByteProcessor(img));
  }
View Full Code Here


    /*****************************************************************************
     * method : reduceColors, reduces the color range for the appropriate format *
     ****************************************************************************/
   
    ImageProcessor reduceColors(ImageProcessor ip) {
        MedianCut mc = new MedianCut((int[])ip.getPixels(), ip.getWidth(), ip.getHeight());
        Image img = mc.convert(256);
        return(new ByteProcessor(img));
    }
View Full Code Here

                             String outputMimeType) throws Exception {
        if (outputMimeType.equals("image/gif")) {
            if (!alreadyConvertedToRGB) {
                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

Related Classes of ij.process.MedianCut

Copyright © 2018 www.massapicom. 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.