# Random Image Compression

**URL:** <https://discourse.processing.org/t/random-image-compression/44235>\
**Category:** Gallery\
**Created:** [April 5, 2024, 12:55am UTC](https://discourse.processing.org/t/random-image-compression/44235 "2024-04-05T00:55:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanc4s](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@seanc4s](https://discourse.processing.org/u/seanc4s)\
**Post date:** [April 5, 2024, 12:55am UTC](https://discourse.processing.org/t/random-image-compression/44235/1 "2024-04-05T00:55:47Z")

</div>

Well, it’s not jpeg, however you could use it to reduce the size of neural networks for image generation or whatever.

> **[Algorithm Shortcuts - Iterative Inverse Random Projections](https://sites.google.com/view/algorithmshortcuts/iterative-inverse-random-projections)**
>
> Having sub-sampled the WHT random projection of an image or similar natural data you can use an iterative restoration method based on binomial filtering. You apply the inverse random projection to the data, smooth it with the filter, project back...

---

<div class="post-metadata">

**Author:** ![seanc4s](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@seanc4s](https://discourse.processing.org/u/seanc4s)\
**Post date:** [April 5, 2024, 9:15am UTC](https://discourse.processing.org/t/random-image-compression/44235/2 "2024-04-05T09:15:47Z")

</div>

A natural image for example has some randomness but also has a lot of embedded order. For example a lot of sine and cosine embedded waves. And those can be extracted to do things like jpeg compression.

You can go the other way though and randomly flip the signs of the data in the natural image. If you go looking for embedded sine and cosine waves you won’t find any. Instead you will find Gaussian noise from the Normal random distribution.  
Are those random numbers useless? No, on the contrary each single one of them contains its fair share of information about all the natural image. And you only need pick a few of them, it doesn’t matter which, do some inversion and smoothing a few times and you get some reasonable representation of the original image back.

---

<div class="post-metadata">

**Author:** ![seanc4s](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@seanc4s](https://discourse.processing.org/u/seanc4s)\
**Post date:** [April 11, 2024, 2:10pm UTC](https://discourse.processing.org/t/random-image-compression/44235/3 "2024-04-11T14:10:07Z")

</div>

I got a nice improvement by doubling the quality of the random projections:  
[https://editor.p5js.org/seanhaddps/sketches/ahSgFi6ue](https://editor.p5js.org/seanhaddps/sketches/ahSgFi6ue)

---

<div class="post-metadata">

**Author:** ![JiyaHana](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jiyahana/32/19209_2.png) [@JiyaHana](https://discourse.processing.org/u/JiyaHana)\
**Post date:** [October 4, 2024, 12:41pm UTC](https://discourse.processing.org/t/random-image-compression/44235/4 "2024-10-04T12:41:15Z")

</div>

Interesting discussion! While the approach you’re sharing is not traditional JPEG compression, it sounds fascinating for optimizing neural networks. I use [https://jpegcompressor.com/](https://jpegcompressor.com/). It’s a simple tool for compressing images without losing quality, which might be useful in different image-related projects."

Confidence level: High
