Why small images?
Don’t send a 1.4mb png when a 30kb jpg will do.
Image optimisation is nothing new. As many of my other developers who touch frontend code know, don’t send huge images to the browser it will slow down page speed. Same applies to the messages you send you colleges.
The last half year, while working from home, more of my communication has been digital than ever before. I knew about image optimisation before, even contributed to an image service lambda at work. I never considered it for the files sent in chat though. With small say under 100kb images communications simply happens faster. The images load faster and are less likely to have problems associated with large assets.
To help with this I started a few months ago working with the ImageMagick cli to make my images smaller. I ran commands like
$ magick mogrify -format jpg -resize '450' ./no_contentful.png
Which converts a large, 1mb+, apple Retina display screen shot down to a small , under 100kb, jpg. This worked well for a while but always manually converting images slowed me down. What if I could just places my screen shots into a folder and resizing just happen? Thats what I decided to build.
I knew wanted something light, that could run in the background, with no GUI. So I reached for a RUST lang. Just had to strap together a few crates.
- clap, for cli interface
- magick_rust, to talk to ImageMagick
- notify, to watch the folders
And Boom. A fully functioning background utility that watches folders for new images and resizes. 🖼 👍
The project is fully open source and available to install via brew or crates.io. More info on the project README.md