Class PaletteQuantizerNeuQuant

  • All Implemented Interfaces:
    PaletteQuantizer

    public class PaletteQuantizerNeuQuant
    extends java.lang.Object
    implements PaletteQuantizer
    NeuQuant Neural-Net Quantisation Algorithm Copyright (c) 1994 Anthony Dekker NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994. See "Kohonen neural networks for optimal colour quantization" in "Network: Computation in Neural Systems" Vol. 5 (1994) pp 351-367. for a discussion of the algorithm. Any party obtaining a copy of these files from the author, directly or indirectly, is granted, free of charge, a full and unrestricted irrevocable, world-wide, paid up, royalty-free, non-exclusive right and license to deal in this software and documentation files (the "Software"), including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons who receive copies from any such party to do so, with the only requirement being that this copyright notice remain intact.
    Author:
    Anthony Dekker - original author, Hernan J Gonzalez - modified for PngReader - no special colours - sequential read, rstein adapted to a modern Java and chart-fx usage
    • Field Detail

      • colormap

        protected int[][] colormap
    • Method Detail

      • convert

        public int[] convert​(int r,
                             int g,
                             int b)
      • convert

        public int[] convert​(int r,
                             int g,
                             int b,
                             int a)
      • isParReserveAlphaColor

        public boolean isParReserveAlphaColor()
      • lookup

        public int lookup​(int r,
                          int g,
                          int b,
                          int a)
        Specified by:
        lookup in interface PaletteQuantizer
      • run

        public void run()
      • setParAlphabiasshift

        public void setParAlphabiasshift​(int parAlphabiasshift)
      • setParBeta

        public void setParBeta​(double parBeta)
      • setParGamma

        public void setParGamma​(double parGamma)
      • setParMaxPixelsToSample

        public void setParMaxPixelsToSample​(int parMaxPixelsToSample)
      • setParNcolors

        public void setParNcolors​(int parNcolors)
      • setParNcycles

        public void setParNcycles​(int parNcycles)
      • setParRadiusbiasshift

        public void setParRadiusbiasshift​(int parRadiusbiasshift)
      • setParRadiusdec

        public void setParRadiusdec​(int parRadiusdec)
      • setParReserveAlphaColor

        public void setParReserveAlphaColor​(boolean parReserveAlphaColor)
      • setParTransparencyThreshold

        public void setParTransparencyThreshold​(int parTransparencyThreshold)
      • initGuard

        protected void initGuard()
        computes neural network if it hasn't been already done
      • indexSearch

        protected int indexSearch​(int b,
                                  int g,
                                  int r)
      • setUpArrays

        protected void setUpArrays()