take byte depth into account