net.sourceforge.jiu.color.reduction
Class ReduceRGB
Reduces the color depth of RGB truecolor images.
This class uses a simple approach, it just drops some of the
lowest bits and scales the value back to eight or sixteen bits per sample.
Supported image classes
This class works with
RGB24Image
and
RGB48Image
.
Usage example
Reduce a 24 or 48 bits per pixel RGB image to 15 bits per pixel:
PixelImage inputImage = ...; // initialize
ReduceRGB reduce = new ReduceRGB();
reduce.setBitsPerSample(5);
reduce.setInputImage(inputImage);
reduce.process();
PixelImage reducedImage = reduce.getOutputImage();
private Integer | destBits - Number of significant bits per channel in the destination RGB image.
|
void | process() - This method does the actual work of the operation.
|
void | setBitsPerSample(int bits) - Specifies the number of bits per sample in the output image.
|
destBits
private Integer destBits
Number of significant bits per channel in the destination RGB image.
setBitsPerSample
public void setBitsPerSample(int bits)
Specifies the number of bits per sample in the output image.
bits
- number of bits in output image, from 1 to 15