Re: Performance problems with 8-bit display

On Thu, 15 Apr 2004 08:50:04 CDT, B McAndrews <bmcandrews efs-us com>  said:
> Hi,
> As anyone had performance problems on an 8-bit display?  Specifically 
> what I am seeing is extremely slow rendering and when it does, finally 
> render, colors are totally messed up.  The conditions that this occurs 
> under are when a large number of X apps are up on the display, including 
> Applix.  Running the app alone appears to be fine.  The display station 
> is running Linux, a copy of the xdpyinfo is shown below.  Thanks for any 
> help.

>   number of colormaps:    minimum 1, maximum 1
>   default colormap:    0x26
>   default number of colormap cells:    256

8-bit is evil, especially when you only have one colormap ;)

What's probably happening is that there's only 256 colors available, your
window manager snarfs a few, Applix uses a bunch, and there's just a few
left over for your gtk-based program.

It "looks OK" when Applix isn't running because then there's more colormap
entries available.

The performance problem is *probably* due to your program trying to redisplay,
and every time it's going "Darn, not enough colors available - let's dither
down to a few less".  So say (for instance) your GTK program needs 200 colors
(quite easy to happen if you have a camera-generated image or similar - those
often have thousands of different pixel values, if not more).

So the program figures out what 200 colors it needs, and tries to allocate
them. Whoops, ran out.. so figure out how many you actually got (say 50).  So
you release the 50 you got, and then go through the 200 colors, and compute
what set of 50 colors provide the "best fit" (basically mapping anywhere from 2
to a dozen or more colors to the same "close" value).  It's even worse if
you're 'dithering', because then a pass has to be made across all the actual
image data.

(No, I don't know if GTK actually does dithering by default).


1) Hope that either your GTK program or Applix has a "install private colormap"
option.  It's ugly, it's messy, the screen changes color every time focus enters/leaves
that program's window - but at least the program gets its own 256 colors to
work with.

2) Find a way to make Applix, your GTK program, and/or your window manager
use less colors, and hopefully get the total requirement down under 256.

3) Unless you have a hardware/software constraint (embedded system, incredible
cash-flow issues, legacy software/hardware that can't be replaced/upgraded,
etc), consider investing $50 in a decent graphics card that does 24-bit color.

Attachment: pgpTWdtepO2kG.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]