1. A method for compensating the impact of at least one defective pixel with a known position in at least one spatial light modulator (SLM) when creating a pattern of said at least one SLM on a work piece covered at least partly with a layer sensitive to electromagnetic radiation, comprising the actions of: projecting an image of said at least one SLM on a detector arrangement to measure a dose of radiation; and performing a compensation of said defective pixel by at least one of the most adjacent pixels in said at least one SLM.