HEIC to JPEG for AI — Resize and Strip Metadata avatar

HEIC to JPEG for AI — Resize and Strip Metadata

Pricing

$10.00 / 1,000 converted images

Go to Apify Store
HEIC to JPEG for AI — Resize and Strip Metadata

HEIC to JPEG for AI — Resize and Strip Metadata

Convert one HEIC image to a bounded JPEG for vision workflows: max 2048px, 2 MB, metadata removed. Base64 input/output. $0.01 per successful conversion.

Pricing

$10.00 / 1,000 converted images

Rating

0.0

(0)

Developer

Stefan Schellen

Stefan Schellen

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

16 hours ago

Last modified

Categories

Share

HEIC to JPEG for AI workflows

Convert one supported HEIC/HEIF photo to JPEG without installing a native codec in your automation platform. Send {"imageBase64":"<raw base64 file bytes>"} and receive one dataset row with mime, width, height, bytes, base64, warnings and schemaVersion.

The output is at most 2048 pixels on its longest side and 2,000,000 bytes. It never enlarges images. Metadata (including EXIF/GPS and XMP) is removed from the generated JPEG. Embedded ICC profiles are converted to sRGB where supported; alpha is flattened onto white with a warning. This is lossy conversion for workflow input, not archival photography or guaranteed OCR accuracy.

Supported input and limits

Raw base64 of one HEIC image, max 10,000,000 decoded bytes and 16,000,000 pixels. Eight-bit sources only. HDR/10-bit/12-bit, multiple top-level images, other formats and corrupt sources are rejected. HEIF orientation is handled by libheif. Not all device variants have been tested. No external URLs are fetched. No API credentials beyond normal Apify access are required.

Pricing

Price: $0.01 per successfully converted image. Rejected input does not trigger our conversion charge. Platform usage for this Actor is included in the displayed conversion price; check the live Pricing tab. An Apify account is required. One image per run.

Workflow

  1. Download the source in your own workflow and base64-encode its binary bytes.
  2. POST the input to the Actor using your Apify credential.
  3. Read the first dataset row. Decode base64 as a JPEG file, or construct data:image/jpeg;base64, plus base64 for a vision endpoint that accepts data URLs.
  4. Inspect warnings. Handle a failed run separately; never treat missing output as a successful conversion.

Input, output and dataset contents are stored by Apify according to your account retention settings. Metadata removal from the output does not delete the original input stored by the platform. Do not submit images you are not authorized to process. The conversion subprocess receives no account credentials.

Free alternatives

Pillow plus pillow-heif can perform this locally at no service charge. This Actor provides hosted execution and a fixed bounded output contract. Other image-conversion Actors and services may be cheaper or support more formats.

Tested behavior

32 local checks cover dimensions, color profiles, metadata removal, input rejection, subprocess timeouts and restart-safe billing. Two public 12-megapixel HEIC fixtures with embedded color profiles converted locally; a spatial photo with two top-level images was rejected. Linux cloud tests use synthetic data. These checks do not establish compatibility with every iPhone mode or image.

The prefilled example is a tiny synthetic color pattern, not a real user photo. Replace it with your own base64 data.

Python HTTP example

import base64, os, requests
from pathlib import Path
response = requests.post(
'https://api.apify.com/v2/acts/creatieve_naald~heic-to-jpeg-for-ai/run-sync-get-dataset-items',
headers={'Authorization': 'Bearer ' + os.environ['APIFY_TOKEN']},
params={'maxTotalChargeUsd': '0.01'},
json={'imageBase64': base64.b64encode(Path('photo.heic').read_bytes()).decode()},
timeout=60,
)
response.raise_for_status()
rows = response.json()
if not rows or 'base64' not in rows[0]:
raise RuntimeError('No converted image returned; inspect the Actor run')
Path('photo.jpg').write_bytes(base64.b64decode(rows[0]['base64']))

For n8n/Make: map your existing binary-to-base64 value to imageBase64 in an HTTP POST node using the same endpoint. Map the first returned row's base64 to your next file or vision step. No bot, OCR subscription or extra conversion-provider key is required.

Troubleshooting: fix the input before retrying

The run's key-value store may contain an ERROR record with an error.code.

  • INVALID_BASE64: send raw, standard base64 of the original file bytes. Remove a data:image/heic;base64, prefix; do not send a filename, URL or the bytes decoded as text. Do not change arbitrary characters to make validation pass.
  • EXPECTED_IMAGE_BASE64_ONLY: send exactly one JSON field, imageBase64.
  • INPUT_TOO_LARGE or PIXEL_LIMIT: use an input within the 10,000,000-byte and 16,000,000-pixel limits. Resizing the output cannot bypass the input decoder limit.
  • MULTIPLE_IMAGES or UNSUPPORTED_HDR: this version cannot process that image variant. Export a supported single-image, 8-bit file with your existing image tool; repeatedly submitting the same input will not help.
  • INVALID_OR_UNSUPPORTED_HEIC or UNSUPPORTED_ICC_PROFILE: use another supported export or a local converter. Do not assume every HEIC from a particular device is supported.

If your HTTP request times out, first inspect the existing Apify run and its output. A timeout does not prove that conversion failed. Do not automatically start another run: this can duplicate processing and charges. A rejected input has no successful-conversion event; this is different from a successful run whose HTTP response was lost. Never publish source images, tokens or private output in support issues.