Lately I've been working on image processing for the Wisweb 2 project. I can safely say that the image processing we had in Wisweb 1 will be greatly improved. In addition to adding some new effects I've corrected a lot of bugs in the old version. Some functions also worked fine in the old version, but didn't always give optimal image quality. They will do that now.
The biggest issue I've met so far has been to export the generated images from Java after all processing has been done. This time we want to support correct export of transparent images. In the old version some pictures were in some cases turned opaque instead of transparent after some processing. All image operations does now support transaprent images.
The final piece of the puzzle is the export of images from a completely processed image to something that can be presented in a web browser. To begin with we want to support JPEG, GIF and PNG. There are many solutions out there, and there is not always the simplest or the most obvious solution which are the best. Java 6 does support export to all these formats, but there are some caveats with some of them.
- Java 6 - Top notch export of images. The quality can be fine tuned until you turn blue. Export of JPEG-images in Java has existes as a hidden library in the standard package since.. well.. not too long after the dawn of time, and is incredebly fast.
We decided to use the buildtin Java functionality without more hesitation here.
- Java 6 - Pictures are exported perfectly, with correct transparency and all, but.. incredibly slow.
- Catcode - Images did not preserve its transparency.
- Objectplanet - Top notch speed, way better than the original. But.. some images got corrupted
The decision fell on the buildtin Java exporter, even though it was not as speedy as we wanted. If anyone knows of any alternative, please drop me a message.
An another challenge here: Convert true-color to 256 colors (color quantizing), transarency, blending.
- Java 6 - Images were converted from true-color to an indexed palette, which resulted in a pretty bad color reduction, and lacked transaprency
- ACME - Does not support color reduction.
- Gurge - Does not support color reduction.
- Gif4J - Really good color reduction. Transaprency were exported perfectly. Lacks blending only.
I've contaced the authors of Gif4J with regard to the blending, and got a positive feedback on this. Even without blending their library is the best library available today.