Skip to content

Convert Images with an API — Automate HEIC, WebP, and AVIF Conversion

I got an email a few months ago from a man running a real estate photography business. He shoots properties on an iPhone, ends up with HEIC files, and has to hand JPGs to agents on a listing platform that accepts nothing else. He’d been converting them one at a time on my site. Forty photos per property, three properties a day.

His exact words: “Is there a way to script this?”

That’s the request that makes you realise you need an API.

Why an image conversion API exists

Most image conversion happens by hand. You open a tool, drop a file in, pick a format, download the result. That’s fine for five photos. It gets tiresome at a hundred a week, and it stops working altogether when the conversion has to happen inside a larger workflow with nobody sitting there to click the button.

The photographer’s case is the clearest version I’ve been sent. The agents he works with shoot on whatever phone they happen to own, so what lands in his intake folder is a mix of HEIC, JPEG and the occasional TIFF that somebody has exported out of an editor without thinking about it. All of it has to come out the other end as JPEG before the listing platform will take it. One conversion call wired into the upload does that while the file is still arriving — no folder to work through in the evening, no decisions for anyone to make. The same shape of problem turns up in mobile backends, where iPhones send HEIC and Android sends JPEG and the pipeline behind them would rather deal with one format than two. If you’re doing that by hand today, the batch converter is the stopgap.

Where the API stands today

Straight answer first, because I’d rather tell you than have you subscribe and find out: the API isn’t live yet. It’s being built. You can’t switch it on from your account page today.

The shape it’ll take is one REST endpoint. POST an image, name the output format, get the converted file back. Inputs: HEIC, AVIF, WebP, PNG, JPEG, GIF, BMP, TIFF. Outputs: JPEG, PNG, WebP, PDF and AVIF. Authentication by key in an Authorization header. Nothing exotic.

If you need programmatic conversion now, email support@heic.site. I’m giving early access to people with a concrete use case, because those are the ones that show what the thing actually has to do. The photographer above shaped more of the design than any amount of guessing on my part would have.

Why not use Sharp, ImageMagick, or ffmpeg?

You absolutely should if you can. They’re battle-tested, and they’ll handle conversion at any scale you’re likely to reach. People reach for a hosted API instead for a short list of reasons, and the most common one is having no server to install anything on. Serverless platforms, mobile apps, locked-down shared hosting: if native binaries are off the table, Sharp and ImageMagick go with them. An HTTP call works from anywhere with a network connection.

HEIC is also a pain to self-host. Decoding it wants libheif and HEVC codecs, which drag patent licensing along behind them. Getting that running on a Linux box is doable but tedious. Getting it running in a Docker image that also has to handle WebP, AVIF and TIFF is how people lose whole days, and I’ve watched it happen more than once. Handing the problem to a hosted service makes it somebody else’s, which is precisely the gap I’m building into.

Then there’s upkeep — image libraries need updates, security patches and the occasional configuration change, and if image conversion isn’t your product then that’s permanent maintenance on something tangential to what you actually sell. Setup time counts as well. Installing and configuring ImageMagick can eat an afternoon when all you wanted was a prototype working before lunch.

When NOT to use an API

If you’re pushing thousands of images an hour, self-hosting will be cheaper and faster. Latency adds up at scale, and you pay for bandwidth in both directions — once to send the original up, once to pull the converted file back.

If everything you handle is already JPEG or PNG, skip the idea entirely. Those formats are universally supported and there’s nothing to convert. A conversion API earns its keep on HEIC, AVIF and WebP, the formats that not every tool reads natively.

If privacy is the binding constraint, host it yourself. Any hosted API means your files travel to a machine you don’t control, and “deleted right after processing” is a different promise from “never left my network” whoever happens to be making the first one. I’d sooner say that plainly than pretend otherwise about a service I haven’t even shipped. The browser converter sidesteps the question completely, because nothing is uploaded to begin with. The trade-off only shows up once you want the automation.

How to get early access

Email support@heic.site and tell me what you’re converting and roughly how much of it. That’s genuinely all I need.

When it ships it’ll be part of heic.site Pro rather than a separate per-request charge, but I’m not charging for it until it works, and this post gets updated the day that changes.