June 14, 2023
Inside Pinside: image processing by imgproxy for pinball lovers
Websites that unite hobbyists, collectible geeks, or fans of games, books, film and so on, usually have user-generated content at their center. Their image processing needs aren’t just focused on format conversion and resizing: these types of projects must ensure the safety of uploaded images as well as the protection of copyright holders. imgproxy has several features that come in handy here: from signed URLs to custom watermarks. This is the story of how we made sure a website dedicated to the pinball community scored big.
Pinside.com brings together pinball enthusiasts from all around the globe. Their large community invites players, collectors, repair gurus, mod-makers, vendors, distributors, restorers, and all-around enthusiasts with one thing in common: a passion and love for the silver ball.
Within a stylish “late 70s/early 80s arcade-flavored” environment, they can discuss games on forums, buy and sell pinball machines, find tech help, read pinball history, and meet others.
The community tools typically involve a lot of user-generated content; Pinside users upload around 40–50K images per month.
According to their code requirements, they have to request these images at various sizes; at least three dimensions are always ‘needed’ for each image, and they do it on the fly. About 30% of the images, uploaded for the classifieds ads section on the site, get watermarked with specific information to avoid their use on other websites. In the end, they implement around a quarter million monthly image operations.
Initially, the Pinside team had to serve this massive amount of activities on their own. They resized images using Imagick from PHP, and at the moment of upload, they generated and stored up to 5 different versions of each uploaded image on their server. This required A LOT of storage and processing power. In general, this process was just too slow.
Because they have over 3 million images in their system and a requirement to keep resized versions for each image, it became a nightmare for their storage premises pretty quickly. They constantly ran out of disk space and paid way more for cloud services than the sites budget would allow.
Then, imgproxy Pro totally changed the game. Once they found and integrated it, the team just needed to store the originals.
Now, the Pinside project uses imgproxy for dynamic resizing and format conversion of all user-uploaded image content. The format and dimensions depend on the location and purpose of the image. For example, they have thumbnail generation (and Pinside highlights that they love how imgproxy can generate thumbnail images from PDF files!), inline (responsive) resize, and large versions (for zooming/downloading).
The team also likes to apply sharpening (the unsharp mask), specifically for thumbnails, making them eye-catching. In addition, the team applies watermarking for some images on their marketplace to prevent scammers from using their website’s images for malicious purposes on other platforms.
The Pinside engineers also confess that generating a required size on the fly is now cheap and easy, and a CDN takes care of caching for them.
The process looks like this: they run imgproxy on a beefy server in a Docker container. Original images are stored on a dedicated storage server (not in the cloud), which allows them to store nearly 3TB of images on a small budget. They used to have imgproxy pull images from their cloud backups (S3 and Backblaze) but paid a lot in data fees. The team rethought their infrastructure and now uses a relatively affordable dedicated storage server, while maintaining cheap backups in the cloud as well.
The engineers greatly appreciate how imgproxy was a no-brainer to deploy (because of docker-compose) and how well-protected it is in terms of security: all URLs can be signed, and there are other security checks in place; plus, it’s easy to strip privacy-sensitive stuff, like EXIF data, from content.
The product is very mature and stable, resource-friendly but still extremely fast. In my opinion, imgproxy is the best self-hosted image processing tool option on the market today.
For the Pinside team, it was also critical to have simple and reliable customer support — and they weren’t disappointed: all their email queries received fast replies and the proper backing without the need to jump through hoops.
You can see just how fast the imgproxy team responds to your own image processing challenges–just complete this form, and we’ll be with you shortly.