The xwininfo command is a utility for displaying information about windows on an X server. One of
the information it displays is the depth of the window, which is the number of bits per pixel used to
represent the color of the window. The depth of the root window, which is the background window
of the X server, is the same as the color depth of the X server. To display the depth of the root
window, one can use the command xwininfo -root and look for the line that says “depth of root
window”. Alternatively, one can use the command xdpyinfo, which displays information about the X
server, and look for the line that says “depths of root window”. Reference:
xwininfo(1) - Linux man page
xdpyinfo(1) - Linux man page
[LPI Linux Certification/Configure the X Window System, Xorg and …]