A computer-implemented method of providing a filtered fingerprint image, comprising: - performing a test operation to detect defective capacitive sensor elements among capacitive sensor elements arranged in a fingerprint sensor array at respective positions therein; - acquiring charge values of the capacitive sensor elements; - acquiring a list of one or more defective capacitive sensor elements detected in the test operation and determining whether the number of defective capacitive sensor elements exceeds a threshold; - in case the number of defective capacitive sensor elements exceeds the threshold, reporting the fingerprint sensor as being broken; - in case the number of defective capacitive sensor elements does not exceed the threshold, for a defective capacitive sensor element in the list, selecting its position as a first position, and: - performing a first operation by placing a first filter window, being a 3-by-3 window, about the first position and computing a replacement value for the first position from charge values within the first filter window, but forgoing computing a replacement value for the first position in case there are only defective capacitive sensor elements within the first filter window; - in case the first operation forgo computing a replacement value for the first position, performing a second operation by placing a second filter window, being a 5-by-5 window, about the first position and computing a replacement value for the first position from charge values within the second filter window if the second filter window encloses more than five non-defective capacitive sensor elements, otherwise forgoing computing a replacement value for the first position; and - in case the second operation forgo computing a replacement value for the first position, reporting the fingerprint sensor as being broken, wherein the test operation is performed in response to a detection of one or more of: - powering on of an electronic device configured with the capacitive fingerprint sensor, - waking from a power-saving mode such as sleep mode or hibernation mode, - a capacitive object such as a being's finger in proximity of or in contact with the capacitive biometric sensor, and - an enrolment process being initiated. - performing a test operation to detect defective capacitive sensor elements among capacitive sensor elements arranged in a fingerprint sensor array at respective positions therein; - acquiring charge values of the capacitive sensor elements; - acquiring a list of one or more defective capacitive sensor elements detected in the test operation and determining whether the number of defective capacitive sensor elements exceeds a threshold; - in case the number of defective capacitive sensor elements exceeds the threshold, reporting the fingerprint sensor as being broken; - in case the number of defective capacitive sensor elements does not exceed the threshold, for a defective capacitive sensor element in the list, selecting its position as a first position, and: - performing a first operation by placing a first filter window, being a 3-by-3 window, about the first position and computing a replacement value for the first position from charge values within the first filter window, but forgoing computing a replacement value for the first position in case there are only defective capacitive sensor elements within the first filter window; - in case the first operation forgo computing a replacement value for the first position, performing a second operation by placing a second filter window, being a 5-by-5 window, about the first position and computing a replacement value for the first position from charge values within the second filter window if the second filter window encloses more than five non-defective capacitive sensor elements, otherwise forgoing computing a replacement value for the first position; and - in case the second operation forgo computing a replacement value for the first position, reporting the fingerprint sensor as being broken, - performing a first operation by placing a first filter window, being a 3-by-3 window, about the first position and computing a replacement value for the first position from charge values within the first filter window, but forgoing computing a replacement value for the first position in case there are only defective capacitive sensor elements within the first filter window; - in case the first operation forgo computing a replacement value for the first position, performing a second operation by placing a second filter window, being a 5-by-5 window, about the first position and computing a replacement value for the first position from charge values within the second filter window if the second filter window encloses more than five non-defective capacitive sensor elements, otherwise forgoing computing a replacement value for the first position; and - in case the second operation forgo computing a replacement value for the first position, reporting the fingerprint sensor as being broken, - powering on of an electronic device configured with the capacitive fingerprint sensor, - waking from a power-saving mode such as sleep mode or hibernation mode, - a capacitive object such as a being's finger in proximity of or in contact with the capacitive biometric sensor, and - an enrolment process being initiated.