A computer implemented method for computing an exposure pattern for exposing a desired pattern on a target by means of a blanking aperture array in a particle-optical lithography apparatus taking into account a finite number of defects (1005, 1105) in said blanking aperture array, said desired pattern being composed of a multitude of image elements within an image area on the target, wherein the blanking aperture array comprises a plurality of blanking apertures arranged within a blanking array area in a predetermined arrangement defining mutual positions of the blanking apertures, each blanking aperture being selectively adjustable with regard to a dose value to be exposed through the respective blanking aperture onto a corresponding aperture image on the target during a respective exposure interval, said dose value taking a value within a common dose interval between a minimum value and a maximum value, with the exception of a finite number of defective blanking apertures, each defective blanking aperture (1005, 1105) exposing either a respective constant dose value or a dose interval incompatible with the common dose interval onto a corresponding aperture image on the target during an exposure interval, wherein during a writing process, a sequence of exposure intervals is made, wherein in each exposure interval the blanking apertures are imaged onto the target, thus generating a corresponding plurality of aperture images, wherein the position of aperture images is kept fixed relative to the target during an exposure interval and coincides with the position of an image element, but between exposure intervals the position of aperture images is shifted over the target, thus exposing a plurality of aperture images so as to cover all image elements within said image area on the target, wherein the method comprises: (a) providing a list of defective blanking apertures, said list comprising information for each defective blanking aperture listed therein, specifying position and either constant dose value or incompatible dose interval of the respective defective blanking aperture, (b) providing the desired pattern and calculating a nominal exposure pattern as a raster graphics defined on the multitude of image elements disregarding the defective blanking apertures, said nominal exposure pattern being suitable to create a nominal dose distribution on the target realizing contour lines of the desired pattern and including for each image element thereof a respective nominal dose value, (c) determining image elements which are exposed by aperture images of defective blanking apertures, referred to as "compromised elements", wherein the method is characterised by the following steps: (d) selecting, for each compromised element, a set of image elements, referred to as "correction elements", said correction elements being located within a neighborhood of, but different from, the respective compromised element within the image area on the target, (e) calculating, for each compromised element, corrected dose values for the correction elements, said corrected dose values minimizing an error functional of the deviation of the nominal dose distribution from a dose distribution on the target calculated with said corrected dose values, under the constraint that each of the corrected dose values fall within the common dose interval; (f) generating, from the nominal exposure pattern, a corrected exposure pattern suitable to expose the desired pattern by said writing process by substituting the corrected dose values for the nominal dose values at the respective correction elements. (a) providing a list of defective blanking apertures, said list comprising information for each defective blanking aperture listed therein, specifying position and either constant dose value or incompatible dose interval of the respective defective blanking aperture, (b) providing the desired pattern and calculating a nominal exposure pattern as a raster graphics defined on the multitude of image elements disregarding the defective blanking apertures, said nominal exposure pattern being suitable to create a nominal dose distribution on the target realizing contour lines of the desired pattern and including for each image element thereof a respective nominal dose value, (c) determining image elements which are exposed by aperture images of defective blanking apertures, referred to as "compromised elements", (d) selecting, for each compromised element, a set of image elements, referred to as "correction elements", said correction elements being located within a neighborhood of, but different from, the respective compromised element within the image area on the target, (e) calculating, for each compromised element, corrected dose values for the correction elements, said corrected dose values minimizing an error functional of the deviation of the nominal dose distribution from a dose distribution on the target calculated with said corrected dose values, under the constraint that each of the corrected dose values fall within the common dose interval; (f) generating, from the nominal exposure pattern, a corrected exposure pattern suitable to expose the desired pattern by said writing process by substituting the corrected dose values for the nominal dose values at the respective correction elements.