
Show HN: Imgsquash – My image compression website project - eashish93
https://github.com/eashish93/imgsquash
======
11235813213455
It's possible to run mozjpeg, pngquant etc.. on the browser (emscripten), to
offload servers from this job

Example:
[https://caub.github.io/misc/optim](https://caub.github.io/misc/optim)

~~~
zawerf
I really like this. Is it maintained? I am guessing the main repo is this one?
[https://github.com/caub/im-optim](https://github.com/caub/im-optim)

If not, can people point me to another out of the box solution?

My use case is that I don't want to build an entire image
preprocessing/thumbnailing pipeline for image uploads. But if I serve the raw
image that the user uploaded, they are typically not optimized for the web.
Since I am letting the user upload anything anyway, it doesn't matter whether
the image processing is secure (e.g., he can totally reverse engineer the js
to upload a non-compressed image, but so what). Client side compression is a
pretty elegant solution since you won't even have to pay for cpu cost to
process the image. If you don't care to keep the original, it will even speed
up the image uploads since they are now smaller. I really see no down sides to
doing this?

~~~
11235813213455
Hey, no, [https://github.com/caub/im-optim](https://github.com/caub/im-optim)
runs on node.js, server-side, and it's not maintained. Someone else mentioned
[https://github.com/GoogleChromeLabs/squoosh](https://github.com/GoogleChromeLabs/squoosh)
for server-side image optimization, it might be better maintained, it seems to
use webpack image optimizers plugins
[https://github.com/GoogleChromeLabs/squoosh/blob/master/pack...](https://github.com/GoogleChromeLabs/squoosh/blob/master/package.json#L48).
There's also
[https://github.com/imagemin/imagemin](https://github.com/imagemin/imagemin)
for doing this

For [https://caub.github.io/misc/optim](https://caub.github.io/misc/optim),
source:
[https://github.com/caub/misc/blob/master/optim.html](https://github.com/caub/misc/blob/master/optim.html),
and it runs the following optimizers (compiled with emscripten to run browser-
side) from a Web Worker: [https://github.com/as-com/mozjpeg-
js](https://github.com/as-com/mozjpeg-js),
[https://github.com/psych0der/pngquantjs](https://github.com/psych0der/pngquantjs)

------
rhardih
For a small scale offline alternative I can heartily recommend
[https://imageoptim.com](https://imageoptim.com).

So simple, yet so effective.

~~~
kilian
And for Linux users: [https://trimage.org](https://trimage.org) (disclaimer: I
made this)

------
snek
the chrome team released a similar tool a few months ago
([https://squoosh.app](https://squoosh.app)). I'm curious how these compare.

~~~
Etheryte
There's also TinyPNG[1] (which also handles jpeg), which offers both an on-
site tool as well as an API as a service.

[1] [https://tinypng.com/](https://tinypng.com/)

~~~
soneca
Funny, I would describe it as TinyJPG (which also handles png) :)

~~~
soneca
Not sure why the downvoting, because I do use the
[https://tinyjpg.com/](https://tinyjpg.com/) website and when people ask for
it the name that comes to mind is _" TinyJPG"_. The opposite of the parent.

Obs: TinyJPG and TinyPNG are the same site

------
karim79
Take a look at [https://kraken.io](https://kraken.io) as well. Emphasis is on
consistency of results and likeness to the original.

------
thisisitnownow
Thanks for sharing this and well done!

------
verisimilitudes
I don't see the appeal. Don't you agree it would be better if the user- ran
this software on their own machines?

~~~
penagwin
At least for me there's been plenty of times where I just want to m I nify a
single image, and potentially on a machine I don't have all my dev tools on.

Also I think this is project is a good side project, regardless if it's really
"necessary"

~~~
tomglynch
Exactly. I sometimes upload an image to imgur for the sole purpose of re-
downloading it compressed.

------
chrisweekly
Reminds me of smush.it from back in the day.

------
samstave
Does it do face stabilization over a range of images of, say, selfies?

If not, does anyone have a recommendation for which app does this?

~~~
fwip
That's not what image compression is.

