Jan-Lukas Else

Thoughts of an IT expert

Tags: Tinify


ShortPixel API

Published on in 🔗 Links

Until today, I used the Tinify API to compress images on my blog. About 250 images per month are free, after that it’s pretty cheap. (I never exceeded the free limit).

View

Published on in 💬 Micro

I use BunnyCDN as storage for my Micropub media endpoint, where I upload all the photos and other media files I publish on my blog. When I upload a new photo the media endpoint first uploads the original file with the name of it’s SHA-256 hash value (so when I upload the same file multiple times, it doesn’t create multiple files). When I upload an image (JPEG or PNG) it also gets optimized and resized to a maximum width of 2000 pixels using the Tinify API (and then uploaded to BunnyCDN too), doing that significantly reduces the file size of the images displayed on my blog.

It would be probably awesome to also serve different formats based on the Accept HTTP header (WebP for browsers that support it) or different sizes, but I decided I want to hold my perfectionism (and the complexity) in check and settle for using just one optimized file version in the original file format. If at some point all browsers support WebP, I might consider using only WebP files, but until then it still takes time.

At the moment I don’t backup the files from BunnyCDN (I trust that they - or I - don’t accidentally delete them), but I could probably setup a cron job to regularly copy new files via FTP from their storage to another storage.

View

Tinify

Published on in 🔗 Links

Tinify or TinyPNG or TinyJPEG is the service I use to automatically compress and resize images uploaded to my micropub media endpoint. It’s a great service with a nice developer API that also offers a free limit of 500 compressions per month and has a pay-what-you-use policy after that (but I won’t upload more than 500 images per month anyway). I use a library written in Go to use the API.

🖼️ View

Jan-Lukas Else