Click to See Complete Forum and Search --> : Question about colour depths in X


MartinB
03-25-2003, 04:07 PM
I've just noticed something very strange on my machine. I'm running my screen at 1024 x 768 in 16-bit colour and run a VNC server also at 1024 x 768, but this of course runs at 24-bit colour.

Now, I can imagine that when connecting from a remote machine to the VNC server, from a Windows desktop set to 24-bit colour, you would get 24-bit colour right? Okay, that works as I expect. But when I connect to the VNC server on the localhost, which is running in 16-bit colour, I also get a VNC viewer screen that is in 24-bit colour. So how can a display which is 16-bit colour run applications in more colours than the display allows for? It just doesn't make any sense to me. I have a window that's in glorious 24-bit colour while all around it the rest of my stuff is in 16-bit... :p

I'm mainly asking this since I only use 16-bit colour because 3D acceleration is unsupported on my graphics card at higher colour depths, but if it is possible to get around this limitation (which the VNC viewer application seems to be doing quite nicely), I'm all for a solution.

Cheers,
Martin

mdwatts
03-26-2003, 06:13 AM
Start vncserver with the correct color depth.

vncserver -depth depth

MartinB
03-26-2003, 07:40 AM
I think you mis-understand or I didn't explain well enough.

What I mean is that it appears that I have X and Fluxbox running locally at 16-bit, yet even though it is running at 16-bit, the VNC Viewer program still seems capable of displaying the 24-bit colour on that is being used by the VNC server on the local 16-bit display. I'm wondering how this is possible.

I took a screenshot to illustrate (It's quite a large file btw). Look at the smoothness of the colours on the background of the VNC viewer window compared to those on the local background.

http://www.avalon-one.net/misc/vncview.png

It's really just more of a curiousity than anything else.

mdwatts
03-26-2003, 02:19 PM
Even though X/Fluxbox is running at 16-bit, it could be (likely is) the vncserver (which is a separate running X server and is required for vncviewer) defaults to 24-bit and you need to specify 'vncserver -depth 16' during the vncserver startup to override the default.

MartinB
03-26-2003, 03:02 PM
I don't want to run the VNC server at 16-bit. I'm happy running it at 24-bit. I just don't understand how a program (the VNC viewer) is able to display 24-bit colour on a display that is only set to 16-bit.

It's kinda hard to explain... Let me try another way... If your screen height is set to 768 pixels, it is not physically possible that you can have more than 768 pixels vertically right? After all, an application wouldn't be able to "split" pixels in half.

Similarly, if the colour depth is set to 16-bit, it's not possible that your screen, or any of the applications running on that screen, or anything else at all on that screen can have more than 65,536 colours displayed, right? Well, it appears that the VNC viewer is somehow breaking that limit...

Yes, the VNC server is set to 24-bit, but wouldn't you expect that the limitations of the local colour depth would reduce the VNC viewer down to 16-bit when being displayed on a 16-bit display? It shouldn't be possible to display 24-bit colour on a 16-bit display.

teeitup
03-26-2003, 03:23 PM
VNC isn't dependant in X.

I run VNC on servers without having X up and running on the server.

MartinB
03-26-2003, 05:05 PM
I know... I also run a VNC server without having X loaded aswell, but the viewer requires that you have X running, and if X is running in 16-bit, how can the viewer show a 24-bit screen?