I change an image like png in memory (i change like Red value of a pixel) after i read it from hard disk. then calculate its hash value and save new image on hard disk. then recalculate its hash from saved image! these two are not same. I want to do this in such a way that these two hash value be same.
Also I used the method in this answer to read image to memory and calculate its hash. ↓
You could save the image to a io.BytesIO(), and take the md5 hash of its value:
Print md5 hash of an image opened with Python’s PIL
For this I think I need to know how to change an image in compress version that can have both hashes same. I really do not know just a guess.
Mebr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.