Class WeightedColorReducer

java.lang.Object
overit.geocall.ux.util.gif.WeightedColorReducer

public class WeightedColorReducer extends Object
Test color quantization of an image.

Usage: Test [image file] [# colors] [# colors] ...

For example:

java quantize.TestQuantize gub.jpg 100 50 20 10
will display gub.jpg with 100, 50, 20, and 10 colors.
Version:
0.90 19 Sep 2000
  • Constructor Details

    • WeightedColorReducer

      public WeightedColorReducer(Image i)
      Creates a new instance of WeightedColorReducer
      Parameters:
      i - The Image
  • Method Details

    • reduce

      public Image reduce(int n) throws IOException
      Reduce the Image
      Parameters:
      n - Int indicating the reduction
      Returns:
      The reduced Image
      Throws:
      IOException - If an I/O exception occurs
    • write

      public void write(OutputStream os) throws IOException
      Write in the OutputStream
      Parameters:
      os - The OutputStream
      Throws:
      IOException - If an I/O exception occurs
    • getPixels

      protected static int[] getPixels(Image image) throws IOException
      Throws:
      IOException