Preprocessing of handwritten signatures from image gradient analysis