NeuQuant Neural-Net Quantization Algorithm Interface
----------------------------------------------------

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.
See also  http://members.ozemail.com.au/~dekker/NEUQUANT.HTML

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, nonexclusive 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, sublicense,
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.


Modified to quantize 32bit RGBA images for the pngnq program.
Also modified to accept a numebr of colors arguement. 
Copyright (c) Stuart Coyle 2004-2006


Rewritten by Kornel Lesinski (2009)
Euclidean distance, color matching dependent on alpha channel 
and with gamma correction. code refreshed for modern compilers/architectures:
ANSI C, floats, removed pointer tricks and used arrays and structs.
