Java Color Quantizer by Gif4J Software
Gif4J gif animation software logotype
Home Page for Gif4J Software java gif image processing products, solutions and services Products Page for java GIF image processing software Purchase java GIF image managing products Download Gif4J GIF image processing products Java imaging FAQs and Gif4J solutions support Contact Page Customer Area
java color quantizer

Gif4J Java Color Quantizer Overview

The Gif4J Java Quantizer is the fastest, most intelligent and qualitative Java-based color quantizer. It supports 8 quantizing modes of operation:
- starting with the extreme fast MEMORY_LOW_FAST
- and finishing the most qualitative MEMORY_NORMAL_OPTIMIZED_DITHER.


The objective of color quantization is converting a full color image (24 Bits per pixel) with a restricted set of color numbers (256, 64, 16 - this value is set by color bit depth (hereinafter CBD)) without a significant (almost perceptually not noticeable by the spectator) lack of color impression approximation as closely as possible when quantized.
Generally speaking quantization can be viewed as a stepwise process:

1. In the first step statistics on the used colors in the image that is to be quantizated are generated (histogram analysis)
2. a) Based on the analysis the color lookup-table has to be filled with values.
    b) The true color values are mapped to the values of the color table. The color values have to be mapped to the nearest color entries in the color table.
3. The original image is quantizated. Each pixel is transformed to the appropriate index of the color table.
4. Optionally an error diffusion technique can be applied.


The Gif4J Java Quantizer is the Java-based implementation of the Wu's Color Quantizer algorithm (see Graphics Gems vol. II, pp. 126-133, Author: Xiaolin Wu).


The Gif4J Java Quantizer supports CBD values between 2 (4 colors) and 16 (65536 colors). It also automatically detects the presence of alpha-channel (image transparency) and retains it unchangeable if CBD more than 8 or converts translucent transparency to bitmask transparency. This implementation supports 2 memory-oriented modes and 4 optimization-oriented modes. The final processing mode is received by combination of one memory and one optimization modes.

MEMORY_LOW mode - Gif4J Java Quantizer uses less memory (up to 4 times) but usually (not always!) generates coarser results.
MEMORY_NORMAL mode - Gif4J Java Quantizer works more accurately but slower (up to 2 times).

Optimization-oriented modes are the next:

FAST mode - the fastest mode (up to 10 times than others modes) but the most rough.
FAST_DITHER mode - based on the FAST mode plus Gif4J Java Quantizer executes additional error dispersion operation based on Floyd-Steinberg dithering algorithm. Please note that due to speed-targeting implementation some small color errors can be occured.
OPTIMIZED mode - optimized version of FAST mode. In this mode quantizer executes some additional operations during color correlation between source and generated color tables.
OPTIMIZED_DITHER mode - based on the OPTIMIZED mode plus Gif4J Java Quantizer executes additional error dispersion operation based on Floyd-Steinberg dithering algorithm.


Please consult the Gif4J Java Color Quantizer API.

Gif4J java gif imaging lib (professional)
Gif4J Java Color Quantizer
Quality Measurements & Benchmark Testing
Test Online
Gif4J PRO Tutorial
Loading GIF Images
Creating GIF Images
Creating GIF Frames
Transform GIF Images
Saving GIF Images
Morphing Filters
Text Rendering
Gif4J java gif imaging lib (light)
Gif4J LIGHT Tutorial
Creating GIF Images
Creating GIF Frames
Saving GIF Images
Home |  Privacy Policy |  Legal Information 
© Gif4J Software 2004-2017