r/coolgithubprojects • • 1d ago

Gorilla, a small but powerful image compressor - v.2.0.0

Today I want to share Gorilla, version 2.0.0. It’s an open-source tool I created that’s super useful for anyone who wants to reduce the size of their images in the following formats:

  • JPG
  • PNG
  • WEBP

I realize it may not be a groundbreaking project, but it’s worth giving it a try to see how it works...

Any feedback that helps improve the tool is welcome :)

Website: https://g0rill4.pages.dev/

40 Upvotes

12 comments sorted by

3

u/power78 21h ago

how does it compress the photos? with a lossy compression algorithm? does it reduce file size? I don't see a technical explanation anywhere

2

u/pontonchief777 15h ago

You're right pal, my next step in developing gorilla should be and will be to implement a section that clearly explains the entire image compression process. However, that part is already public for anyone who wants to view the code in the GitHub repository.

1

u/power78 15h ago

Booo. Why not answer?

1

u/pontonchief777 14h ago

I'm not sure what you meant, but to be clear with you and everyone else... the tool uses the browser itself to decode each image with `createImageBitmap` and then re-encodes it according to the format. For PNG, the `image-worker.js` worker (using UPNG) applies color quantization with `cnum` (0 for Light, 256 for Balanced, 128 for Strong) and removes metadata during re-encoding; if the worker isn’t available, UPNG is used directly on the main thread. For JPG and WEBP, Compressor.js is called with quality (0.85, 0.7, or 0.5) and maxWidth/maxHeight (2560, 1920, or 1280 pixels), with retainExif set to false. Each compression level is tested in `probeCompressionLevels`, and only those that produce a blob smaller than the original are enabled and, for PNG, only those that actually quantize; if none meet these criteria, the app displays “no option reduces the file size.” Nothing leaves the browser: processing is local, and only the libraries are downloaded from a CDN with SRI verification.

1

u/Gasperhack10 7h ago

Its a bot

2

u/Equal-Resolution7889 1d ago

I've just tried it and it works very well. I really like the tabs, it's a good idea.

1

u/pontonchief777 1d ago

Thanks pal :) i'm glad it was helpful to you

1

u/not_afraid_of_trying 11h ago

Compare this against these open source, free and privacy friendly image compressors

  1. https://squoosh.app (lot of tweaking options)
  2. https://massimg.com (balanced tweaking options)
  3. https://caesium.app/ (minimal tweaking options but often sufficient)

If you say exactly how it is different, people may be interested in reviewing it.

2

u/pontonchief777 11h ago

thanks bro I'll keep that in mind for the next version of the project, since it's just getting started and there are some bugs I'll fix and lessons I'll learn along the wayy

1

u/Exciting_Active4857 9h ago

any comparison with pngquant/oxipng/zopfli