It sounds like you might be dealing with photocopy images, or scanned images. Something that is more likely to be stored as .jpg file than a .txt file.
This is why it is difficult. The jpeg (or any similar image format) doesn't understand text, it just understands pixels (oversimplifying here but go with it).
To interpret "specific parts" of an image. Like a date of birth or a name within a document is a whole interesting challenge for machine learning in its own right. If you can possibly go by generous coordinate regions of the image you'll have a much easier go of it.
Hopefully you're dealing with a known set of forms or something and you can pair some metadata with the image to lookup how to redact it.