What are Indexed Colorspaces?
Indexed Colorspaces store a list of the colors used and reference that list to get the color of each pixel, rather than directly referencing each color value for a pixel in an image.
Why are Indexed Colorspaces useful?
Indexed colorspaces are very useful if you only have a limited number of colors in an image. If you only use 2 colors, you can create a table to store the 24bit color values (6 bytes) and then reference them as a pointer to which value to use (0 or 1) which only needs 1 bits. So each pixel will use a quarter of a byte as opposed to 3 bytes (a file size saving of 24 times which can be a very big number on large images.
If you have less than 16 colors, you need a 4 bit look-up and even if you have 255 colors you will still save 2 bytes for every pixel.
And the disadvantages?
The main disadvantage of indexed colorspaces is that they make reconstructing the image more complicated. They are also less beneficial if the image contains lots of colors.
Some examples of how IndexedColorpaces are used
In Java there is an IndexedImage type or you can use the lookup table to build the original image data. This is also optimised for speed so it is faster and more memory-efficient.
The PDF file format uses IndexedColorspaces to reduce the size of PDF files.
GIF image files use a lookup table to reduce the size of the files created.
Are you a Java Developer working with Image files?
What is JDeli?
JDeli is a commercial Java Image library that is used to read, write, convert, manipulate and process many different image formats.
Why use JDeli?
To handle many well known formats such as JPEG, PNG, TIFF as well as newer formats like AVIF, HEIC and JPEG XL in java with no calls to any external system or third party library.
What licenses are available?
We have 3 licenses available:
Server for on premises and cloud servers, Distribution for use in a named end user applications, and Custom for more demanding requirements.
What's our Story?
We are a small company who have been developing innovative Java, PDF and HTML5 solutions for over 25 years.