A processor-implemented method, comprising: receiving, via a masking system, an input image specific to an application form, wherein the input image indicates one or more headers and corresponding fields; obtaining an input comprising one or more pairs of a label and a corresponding value, each of the one or more pairs of the label and the corresponding value serve as coordinates and storing the input image along with the coordinates in a database, wherein a Personal Identifiable Information, PII, label, a position of the PII label and one or more value patterns are captured for each PII field present in the input image, and further wherein based on the captured PII label an approximate location of a PII text within the input image is calculated; creating a job flow for the input image, wherein the job flow shows all the PII that got trained and a user can provide a masking rule for each PII field, calculating (i) a relative distance, RD between the label and the corresponding value for each of the one or more pairs, and (ii) a direction of the corresponding value with respect to the label, using the coordinates; receiving a test image specific to a test application form; performing an optimization technique on the test image, wherein the step of performing an optimization technique on the test image comprises at least one of: upon determining a tilt in the test image, performing a tilt correction of the test image to obtain a tilt corrected image serving as the test image; and scaling the test image or the tilt corrected image to a predefined resolution; performing an optical character recognition, OCR technique on the test image to identify one or more words comprised in the test image; performing a comparison of (i) the label of each of the one or more pairs with (ii) one or more words comprised in the test image to obtain one or more matching labels of the test image; calculating a masking area of each of the one or more matching labels using the calculated relative distance and the calculated direction; generating a corresponding masking string for a corresponding value of each of the one or more matching labels using the calculated masking area; and masking an original area of the corresponding value of each of the one or more matching labels with the corresponding generated masking string to obtain a masked test image, wherein during masking, the OCR technique is applied on the test image present in the database to extract one or more text values and co-ordinates of the one or more text values. receiving, via a masking system, an input image specific to an application form, wherein the input image indicates one or more headers and corresponding fields; obtaining an input comprising one or more pairs of a label and a corresponding value, each of the one or more pairs of the label and the corresponding value serve as coordinates and storing the input image along with the coordinates in a database, wherein a Personal Identifiable Information, PII, label, a position of the PII label and one or more value patterns are captured for each PII field present in the input image, and further wherein based on the captured PII label an approximate location of a PII text within the input image is calculated; creating a job flow for the input image, wherein the job flow shows all the PII that got trained and a user can provide a masking rule for each PII field, calculating (i) a relative distance, RD between the label and the corresponding value for each of the one or more pairs, and (ii) a direction of the corresponding value with respect to the label, using the coordinates; receiving a test image specific to a test application form; upon determining a tilt in the test image, performing a tilt correction of the test image to obtain a tilt corrected image serving as the test image; and scaling the test image or the tilt corrected image to a predefined resolution; performing an optical character recognition, OCR technique on the test image to identify one or more words comprised in the test image; performing a comparison of (i) the label of each of the one or more pairs with (ii) one or more words comprised in the test image to obtain one or more matching labels of the test image; calculating a masking area of each of the one or more matching labels using the calculated relative distance and the calculated direction; generating a corresponding masking string for a corresponding value of each of the one or more matching labels using the calculated masking area; and masking an original area of the corresponding value of each of the one or more matching labels with the corresponding generated masking string to obtain a masked test image, wherein during masking, the OCR technique is applied on the test image present in the database to extract one or more text values and co-ordinates of the one or more text values.