The present invention relates to a method to detect at least one defective pixel in a spatial light modulator comprising numerous pixel elements. The spatial light modulator is imaged to a detector. A relayed image of a first chess-board pattern of pixels in said spatial light modulator is detected by said detector. A relayed image of a second chess-board pattern of pixels in said spatial light modulator is detected, which is inverted to the first chessboard pattern, by said detector. The relayed images of said first and second chessboard patterns are analyzed to detect differences between said detected images and theoretical images thereof.