That would be a cryptographic hash you are describing. Not all hash functions share that property. As long as arbitrary input is mapped to a fixed size output it is a hash function. For example see NeuralHash [1] which is a hash function designed to be "insensitive to small changes in the input image."
[1] https://towardsdatascience.com/apples-neuralhash-how-it-work...