Pixel Depth vs. Color Depth

The question is, what is the difference between color depth and pixel depth?

Searching Pixel Depth on google simply give links to Color Depth. Even the dictionary defines pixel Depth as bit depth, which according to wikipedea is actually Color Depth. Wikipedia says,

Color depth, also known as bit depth, is either the number of bits used to indicate the color of a single pixel...

So does it mean "Color Depth", "Bit Depth" and "Pixel Depth" are all one and the same thing? If yes then is this w3schools article wrong which says,

For modern computers, Color Depth and Pixel Depth are equal.

The line above implies in older computer Color Depth and Pixel Depth were different.



Nice, all that w3Schools bashing in the comments, but they are actually right. The article is not about the terms pixel depth vs color depth, but about the properties of the screen object.

screen.pixelDepth and screen.colorDepth are two different properties, so it's imaginable that they have different values. However, currently they are fixed to 24 (says also Mozilla). This is by specification, although there was a bug in WebKit that made it return 32..

The examples on the Mozilla page suggest that they could be lower, but currently (on modern computers, including modern smartphones) they are always 24

The real answer can be found on QuirksMode:

The difference between colorDepth and pixelDepth is only important on (older?) Unix machines, where old X-clients may allow applications to define their own color scheme. If that’s the case, colorDepth matches the color depth of the application and pixelDepth the color depth of the monitor. In all other cases they’re equal.

So it seems that that remark is correct.

In daily use, you might consider using colorDepth, because pixelDepth is not supported in IE8 and before, although that is hardly relevant today.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.