1. A method for determining at least one defective pixel in a set of pixels from a digital image, with the set of pixels being two-dimensional and with each pixel having neighboring pixels belonging to the set of pixels, the method comprising: selecting from the digital image a plurality of peripheral pixels and a central pixel for analysis using a diamond shaped or rectangular window; analyzing the selected pixels within the diamond shaped or rectangular window based on the following calculating an absolute value in differences of intensity for pairs of neighboring pixels, with the pairs of neighboring pixels being two-dimensional; comparing the absolute values to a threshold; and excluding a presence of each potentially defective pixel when no more than one of the absolute values is larger than the threshold, otherwise deciding whether or not there is a defective pixel as a function of the comparing.