Gif issue resolved :-)
A great thanks to Paul Nicholls who pointed me to the right solution. This is absolutely brilliant the way a community can work.
Apparently the culprit is GDI which use a web safe colours palette when you use image GIF format. Quite odd because this is way back to the time where users didn't have more than 256 colours from their graphics card.
I hope this can be solved in .Net 2. By the way does somebody know if we have to expect some new features in GDI+ 2.0 ?
Check this article on MSDN to know more about the solution which is to render a GIF image with a different palette. I choose the adaptive one (OctreeQuantization method) and it's perfectly fine.
The results of the quantization process are shown below.
Quantization Type | Image | Image Size (in KB) |
---|---|---|
None (default GDI+) | 21342 | |
Palette-based | 16748 | |
Octree-based | 16744 |
Figure 5. Comparison of quantization results
The palette and Octree results are 20 percent smaller than the default GDI+ rendering using a Web-safe palette, and the image quality is far superior. The palette- and Octree-based images are different because the images contained slightly differing text. Your results may vary based on the size of the image, but generating images that are smaller yet better has to be worthwhile.