pixelDepth property
Gets the number of bits per pixel that is used for colors on the destination device or buffer.
![]() |
Syntax
| JavaScript | |
|---|
Property values
Type: Integer
-
The number of bits per pixel, expressed as an integer, to use for the off-screen buffer. The value 15 specifies 16 bits per pixel, in which only 15 bits are used in a 5-5-5 layout of RGB values.
Standards information
- CSSOM View Module, 4.2
Remarks
If you retrieve the value of the pixelDepth property through a script, you can select an appropriate color to return to the browser.
If bufferDepth is 0 or -1, pixelDepth is equal to the bits-per-pixel value for the screen or printer.
If pixelDepth does not equal zero, pixelDepth is equal to colorDepth.
See also
Show:
