I think what you are looking for is "Perceptual Hashing".
What I understand from your question is that you need a way for programmatically identifying images even when they have been manipulated beyond human recognition.
Their is a Microsoft project called PhotoDNA. I believe the have a cloud API.
You may also want to look at this Python example