TL;DR: Please check out and support my Edit Images Pack — the one I built for the Packathon.
It’s freaking dope what it can do.
The short answer: by adding special URL parameters to uploaded image URLs.
The long answer
The main purpose of imgix is to optimize images for loading on different devices and in different countries. It can covertly resize images for different screen sizes, subtly reduce quality to save up on size and loading time, and serve images in a better format. The way it works is that you set it up on your online storage (e.g. an Amazon bucket), give it a custom domain, and it does all the magic for you.
Actually that’s what I hinted at in my previous trick: the image is uploaded to
codahosted.io but is then served to the doc through the
codaio.imgix.net server, with
auto=compress,format options turned on. To get the original image served, all you had to do was to replace the domain back to the original one and remove any query parameters from it.
That said, optimization is not all that imgix does.
If you look into its Rendering API, you’ll see a hundred of things you can do to those images, from resizing and cropping to compositions (a blend and a watermark), face detection and palette extraction. All of these can be accessed by simply adding
&url=parameters to the image’s imgix URL, like this:
And composition can be done by overlaying a “watermark” (doesn’t have to be a watermark) or a “blend” with Normal blending mode, e.g.:
If you read the long description above you know that it didn’t even have to be a pack — you could just
Concatenate() the URLs yourself right in Coda Formula Language.
Yet this pack still goes an extra mile:
It is well documented
The formulas and their parameters are redesigned to be more intuitive.
With raw URL manipulation you’d have to go and learn which arguments play nicely with which and what depends on what. The way I organized it in my pack, you won’t have to figure.
By default, imgix only allows blending of three layers (the base, the blend, and the watermark).
I hacked the way to bring it up to 5, and there may be some room to squeeze in a few more.
It’s still WIP. I released what I managed to make in time for the Packathon, therefore some features from imgix didn’t make it. But rest assured I’ll add them by the end of August.
I participated in the 2022 Coda Packathon and this is my submission for it.
Right now there’s Community Voting going on. Aside from the 1st, 2nd, and 3rd prizes, the top voted doc will win an extra $1k prize for being the Community darling
I could really use some support. If you liked what I did, please give Edit Images a
(and check out other submissions as well)