<p>Unlike a <em>compression</em> function, which can be reversed to recover (an approximation to) the original data, a <em>hash</em> function is irreversible. You can hash your image, and the hash is a lot smaller than the original image, but you can't get the original image back from the hash.</p>

<p>A hash function <em>is</em> useful for cases where there are only a small number of possible images, which everyone knows about. An example use-case might be something like Telegram or WhatsApp stickers, where there's a fixed set of images, and centrally assigning ID numbers causes distributed systems problems.</p>

CC BY-SA 3.0
2018-02-13T16:03:53.910Z
i understand,but my idea is: 110011 + hash code = 00ii00 = 0110, i is complex number and converted to 1,1 is converted to 0 and 00 is 0.
Lan...
CC BY-SA 3.0
2018-02-13T16:16:26.610Z
so 01101110 will become 101001,let's decode: original zero is always invert to 1,1 is always converted to zero,two zero after converted is converted to only 0.
Lan...
CC BY-SA 3.0
2018-02-13T18:58:18.497Z
I have no idea what you're talking about. I don't think you're describing a hash code.
Dan Hulme
CC BY-SA 3.0
2018-02-14T00:10:12.183Z
then i quantized the code with my own algorithm,i have test this several times with different code length and it can recreate 99% of code. 101001 = 001.after recreated = 01101110,this is normalized and it works for all different binary code.
Lan...
CC BY-SA 3.0
2018-02-14T00:13:01.460Z
i even still can use hash code,but i use real time hash with only hash the high logic value in a binary code.
Lan...
CC BY-SA 3.0
2018-02-14T09:41:24.667Z
@Lan... it sounds like you have no idea how compression works. Do some research to understand the pigeon hole issue.
ratchet freak
CC BY-SA 3.0
2018-02-13T15:27:03.897Z
2018-02-13T15:27:03.897Z
Dan Hulme
<p>Why don't we just use a hash function to reduce the size of a bitmap, rgb or raw image? Isn't it more efficient of storage data and it produces lossless image after being decoded? The decoder is also very simple, and it would use an universal standard hash code for all images. Some private image would have its own hash code. Isn't it an opportunity for us to compress a file to very low capacity, without any complicated algorithm and entropy code?</p>

CC BY-SA 3.0
2018-02-14T09:09:21.453Z
Are you implying that everyone keeps a database of images on their computer that's indexed by the "universal hash"?
Simon F
CC BY-SA 3.0
2018-02-16T21:41:34.287Z
I also went through a stage of thinking up lots of brilliant ideas to use hashes to get around limits on compression. It took a long time to realise why they definitely cannot work. I recommend reading about [data compression](https://en.wikipedia.org/wiki/Data_compression).
trichoplax is on Codidact now
<image-processing>
Why not use hash function image instead of jpeg?
Lan...
# Why not use hash function image instead of jpeg?

(Asked by: username_0 on 2018-02-13)

Why don't we just use a hash function to reduce the size of a bitmap, rgb or raw image? Isn't it more efficient of storage data and it produces lossless image after being decoded? The decoder is also very simple, and it would use an universal standard hash code for all images. Some private image would have its own hash code. Isn't it an opportunity for us to compress a file to very low capacity, without any complicated algorithm and entropy code?

**Tags:** image-processing

> **Comments:**
> **username_1**: Are you implying that everyone keeps a database of images on their computer that's indexed by the "universal hash"?  
> **username_2**: I also went through a stage of thinking up lots of brilliant ideas to use hashes to get around limits on compression. It took a long time to realise why they definitely cannot work. I recommend reading about [data compression](https://en.wikipedia.org/wiki/Data_compression).  

---

## 1 answers

### Answer by username_3 on 2018-02-13. Score: 6

Unlike a *compression* function, which can be reversed to recover (an approximation to) the original data, a *hash* function is irreversible. You can hash your image, and the hash is a lot smaller than the original image, but you can't get the original image back from the hash.

A hash function *is* useful for cases where there are only a small number of possible images, which everyone knows about. An example use-case might be something like Telegram or WhatsApp stickers, where there's a fixed set of images, and centrally assigning ID numbers causes distributed systems problems.

> **Comments:**
> **username_0**: i understand,but my idea is: 110011 + hash code = 00ii00 = 0110, i is complex number and converted to 1,1 is converted to 0 and 00 is 0.  
> **username_0**: so 01101110 will become 101001,let's decode: original zero is always invert to 1,1 is always converted to zero,two zero after converted is converted to only 0.  
> **username_3**: I have no idea what you're talking about. I don't think you're describing a hash code.  
> **username_0**: then i quantized the code with my own algorithm,i have test this several times with different code length and it can recreate 99% of code. 101001 = 001.after recreated = 01101110,this is normalized and it works for all different binary code.  
> **username_0**: i even still can use hash code,but i use real time hash with only hash the high logic value in a binary code.  
> **username_4**: @Lan... it sounds like you have no idea how compression works. Do some research to understand the pigeon hole issue.  

---

