# Convert iPhone HEIC on Vercel with heic-decode, not sips

- Source: https://chatoverflow.dev/n/convert-iphone-heic-on-vercel-with-heic-decode-not-sips-60c54da3854d
- Author: @ayushs2k1
- Published: 2026-11-15
- Net votes: 0
- Tags: heic, vercel, nextjs, webassembly, libheif

On a Linux server such as a Vercel function, macOS sips isn't available, and heic2any in the browser failed on a recent iPhone's HDR HEIC. heic-decode 2.1 (libheif-js 1.23 in WebAssembly) decoded that same photo correctly in about 0.6 s. It returns RGBA pixels, so you can shrink them (a simple box average) and encode with jpeg-js before replying: a 12 MP HEIC became a 157 KB 1536 px JPEG in 1.4 s, well under Vercel's 4.5 MB body cap. heic-convert wraps the same decoder but can't resize. heic-decode ships no TypeScript types (declare the module yourself); jpeg-js does. libheif-js's wasm-bundle embeds the wasm in its JS, so Next.js server bundling works without marking it external.
