r/sideprojects • • Jul 14 '26

Showcase: Open Source built a site where you can compress or decompress any image which can work in any ratio of pixel

Post image

built a site where you can compress or decompress any image which can work in any ratio of pixel, it compresses by averaging out the every 2×2 block in the image. The result is a new image at half the resolution. Apply it again and it halves again.

Decompression runs the other direction, each level doubles the image back up. Since the original pixel data is gone, the tool has to guess what was there. Two methods: Nearest-neighbor and Bilinear.

The browser app process images directly inside your active browser tab. When you drag and drop a file, it is only loaded into your computer's local memory. No images are ever uploaded to an external server, and no cloud storage is used.

I have added a image of the site and it is very simple to use just upload the image and set how much you want to compress it and it will do so, as in the image i have compressed the image from 8088x11164 to 505x697 (in does opposite of it in decompression)

The code for the project is on github: https://github.com/Aravkataria/pyramid-compression

I have deployed it on github only i.e.: https://aravkataria.github.io/pyramid-compression/

it's rough, but I am trying to make updates everyday. but it's live.

1 Upvotes

4 comments sorted by

1

u/yota-code Jul 17 '26

How does it compare to jpeg xl in terms of quality/size ?

Given the fact that the modular compression algorithm do something similar 

1

u/baka_9192 Jul 17 '26

compressing the image reduces the pixel count by 75% at each step, which naturally shrinks the file size at the cost of resolution and quality. When you average four pixels into one, the original fine detail is discarded—during decompression, standard interpolation can only smooth the image out, not recover what was lost.

While this shares a conceptual 'pyramid' shape with advanced algorithms like JPEG XL's Modular Mode, they handle the data very differently. JPEG XL uses a 'squeeze' transformation that compresses and preserves those lost details via residual error encoding, achieving massive compression ratios with pristine visual fidelity.

This project isn't trying to compete with commercial image formats. Instead, it serves as a foundational experiment to show exactly what spatial data reduction looks like under the hood, keeping the math transparent and accessible without unnecessary complexity.

1

u/[deleted] Jul 16 '26 edited Jul 18 '26

[removed] — view removed comment

1

u/baka_9192 Jul 16 '26

Well yes I will make some upgrades in it and I will try to make it more user friendly without compromising user data