Board index » delphi » Server created images looks right only on 24bits resolution

Server created images looks right only on 24bits resolution

Hey there everyone,

Currently, I'm working on a CGI that creates dynamic images on the server,
everything is working right, except that the server must use 24bit
resolution or it won't look right on the client. Currently, it's using
delphi JPEG format, Ander Melander GIF library. If the server uses 16colors
it doesn't look right on the client.

Anyone knows what's happening ?

thx

 

Re:Server created images looks right only on 24bits resolution


Quote
Gustavo Daud <gu...@sti.com.br> wrote in message

news:7pmgsm$atd13@forums.borland.com...

Quote
> Currently, I'm working on a CGI that creates dynamic images on the server,
> everything is working right, except that the server must use 24bit
> resolution or it won't look right on the client. Currently, it's using
> delphi JPEG format, Ander Melander GIF library. If the server uses 16colors
> it doesn't look right on the client.

Could you post a short example of exactly how you're creating an
image?
___
efg

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

efg's Computer Lab:  http://www.efg2.com/Lab

Re:Server created images looks right only on 24bits resolution


The Delphi graphics components are designed to automatically use the bit depth
of the computer they're running on. You can override this by setting their
PixelFormat property to pf24bit, or jf24bit in the case of TJPEGImage.
Quote
Gustavo Daud wrote:
> Hey there everyone,

> Currently, I'm working on a CGI that creates dynamic images on the server,
> everything is working right, except that the server must use 24bit
> resolution or it won't look right on the client. Currently, it's using
> delphi JPEG format, Ander Melander GIF library. If the server uses 16colors
> it doesn't look right on the client.

> Anyone knows what's happening ?

> thx

Re:Server created images looks right only on 24bits resolution


16 color (4 bits per pixel) images never look right when the original image
has more than 16 colors.  There just aren't enough midtones to dither up a
reasonable approximation of the high color image.

Delphi doesn't attempt to employ sophistocated color reduction or dithering
techniques.  We just tell GDI how many colors we want and let the video
driver figure out what to do to make it happen.

Also note that due to widespread video driver problems in handling 16 color
palettes, Delphi ignores the color palette in 16 color BMPs.  If you're
creating a BMP at 4 bits per pixel for use in Delphi, you must render the
image using the "stock" VGA 16 color palette, because that is what Delphi
will draw the image with when it loads it later.  I say "stock" because
video card vendors don't use exactly the same colors values in the VGA
hardware palette.

-Danny

Other Threads