A method of correcting for pixel defects in the output of an image sensor, the method comprising: performing a preliminary filtering operation which operates on couplet defects (26, 28) wherein two adjacent pixels in a given colour plane are defective, said preliminary filtering operation comprising: replacing the signal value of a first pixel in the couplet with a corrected signal value and ignoring the other defective pixel value in the couplet, and thereafter performing a main filtering operation on the signal resulting from the preliminary filtering operation, wherein said main filtering operation comprises the steps of: obtaining a central pixel value and a plurality of neighbouring pixel values characterised in that said preliminary filtering operation further comprising identifying the scanning direction of a readout process, and, based on said identification, choosing the pixel value of the neighbouring non-defective pixel preceding the first pixel first available in the direction of scanning as the corrected signal value in said given colour plane wherein the first pixel of the couplet is the first pixel in the identified direction of scanning; and further characterized in that said main filtering operation further comprising determining the average value of each opposing pair of pixel values; comparing each average value with the central pixel value; and replacing the central pixel value with the average value which is closest to the central pixel value. performing a preliminary filtering operation which operates on couplet defects (26, 28) wherein two adjacent pixels in a given colour plane are defective, said preliminary filtering operation comprising: replacing the signal value of a first pixel in the couplet with a corrected signal value and ignoring the other defective pixel value in the couplet, and thereafter performing a main filtering operation on the signal resulting from the preliminary filtering operation, wherein said main filtering operation comprises the steps of: obtaining a central pixel value and a plurality of neighbouring pixel values characterised in that said preliminary filtering operation further comprising identifying the scanning direction of a readout process, and, based on said identification, choosing the pixel value of the neighbouring non-defective pixel preceding the first pixel first available in the direction of scanning as the corrected signal value in said given colour plane wherein the first pixel of the couplet is the first pixel in the identified direction of scanning; and further characterized in that said main filtering operation further comprising determining the average value of each opposing pair of pixel values; comparing each average value with the central pixel value; and replacing the central pixel value with the average value which is closest to the central pixel value. replacing the signal value of a first pixel in the couplet with a corrected signal value and ignoring the other defective pixel value in the couplet, and thereafter performing a main filtering operation on the signal resulting from the preliminary filtering operation, wherein said main filtering operation comprises the steps of: obtaining a central pixel value and a plurality of neighbouring pixel values characterised in that said preliminary filtering operation further comprising identifying the scanning direction of a readout process, and, based on said identification, choosing the pixel value of the neighbouring non-defective pixel preceding the first pixel first available in the direction of scanning as the corrected signal value in said given colour plane wherein the first pixel of the couplet is the first pixel in the identified direction of scanning; and further characterized in that said main filtering operation further comprising determining the average value of each opposing pair of pixel values; comparing each average value with the central pixel value; and replacing the central pixel value with the average value which is closest to the central pixel value.