The generation of images is relatively simple – create a surface to draw on, render the appropriate image, and save this to the ASP.Net response stream to be returned to the user.
The only problem with this scenario is the resulting image – GDI+ will by default utilize a web safe palette when converting a bitmap to an image suitable for a web page (such as GIF/Jpeg), and so the resulting image will be of poor quality and may contain various stray colors from the color reduction algorithm used. This conversion to a web safe palette occurs before the image is converted to the output type (such as GIF/Jpeg), so even though the output type may support many colors, the image will be generated to use colors from the web safe palette.
|