I am looking to upgrade my RAW workflow. PhotoLab looks like a strong choice due to superior RAW processing of my Sony A7C II photos.
One blocking problem remains: I have found no convenient workflow to store final edited photos to Apple Photos where my library resides. The options I see in PhotoLab are either JPEG (6MB) that reduces color accuracy and depth or DNG (with all corrections applied). DNG looks great, but is 129MB. I can export DNG in Photos to HEIC, re-import, and delete DNG. This yields the desired result: accurate colors, preserved depth/resolution, and small image size (3MB). But it requires way too many manual steps.
What is the right way to export from PhotoLab to Apple Photos in a proper archival format (HEIC)?
If this is not possible in PhotoLab, would Lightroom or CaptureOne be able to do it?
The least bad option seems to be to export as 16bit TIFFs to a folded and then convert them there with sips and import to Photos.
Something like this
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# import.sh
# - Converts TIFF/TIFFs to HEIC using sips, deletes TIFF if conversion succeeds
# - Picks up orphan HEIC/HEIF files in the folder
# - Imports all HEIC/HEIF to Photos (no album)
# - Deletes HEIC/HEIF originals on disk if import succeeds
WATCH_DIR="${1:-$HOME/Pictures/import-to-photos}"
DRY_RUN="${DRY_RUN:-0}" # set to 1 for dry run (no import, no deletes)
log() { printf '%s\n' "$*" >&2; }
# Collect TIFFs (bash 3.2 compatible)
tiffs=()
while IFS= read -r f; do
tiffs+=("$f")
done < <(find "$WATCH_DIR" -maxdepth 1 -type f \( -iname "*.tif" -o -iname "*.tiff" \) -print)
failed=0
# Convert TIFF -> HEIC and delete TIFF on success
if [[ "${#tiffs[@]}" -gt 0 ]]; then
log "Found ${#tiffs[@]} TIFF(s) in: $WATCH_DIR"
for tif in "${tiffs[@]}"; do
base="${tif%.*}"
heic="${base}.heic"
log "Converting: $tif -> $heic"
if [[ "$DRY_RUN" == "1" ]]; then
continue
fi
if sips -s format heic "$tif" --out "$heic" >/dev/null 2>&1 && [[ -s "$heic" ]]; then
rm -f -- "$tif"
log "OK: converted and deleted TIFF"
else
log "ERROR: conversion failed for: $tif"
rm -f -- "$heic" 2>/dev/null || true
failed=1
fi
done
else
log "No TIFF files found in: $WATCH_DIR"
fi
if [[ "$failed" -ne 0 ]]; then
log "One or more conversions failed. Skipping Photos import."
exit 1
fi
# Collect HEIC/HEIFs to import
heics=()
while IFS= read -r f; do
heics+=("$f")
done < <(find "$WATCH_DIR" -maxdepth 1 -type f \( -iname "*.heic" -o -iname "*.heif" \) -print)
if [[ "${#heics[@]}" -eq 0 ]]; then
log "No HEIC/HEIF files found to import in: $WATCH_DIR"
exit 0
fi
log "Will import ${#heics[@]} HEIC/HEIF file(s) from: $WATCH_DIR"
[[ "$DRY_RUN" == "1" ]] && log "DRY_RUN=1 (no import, no deletions)"
if [[ "$DRY_RUN" == "1" ]]; then
exit 0
fi
# CRITICAL FIX:
# Use `osascript -` to explicitly tell osascript "read the script from stdin".
# Otherwise, it interprets the first path you pass as the script filename, causing the -2740 error you saw.
osascript - "${heics[@]}" <<'APPLESCRIPT'
on run argv
if (count of argv) < 1 then error "No files provided."
tell application "Photos"
repeat with p in argv
set posixPath to (contents of p)
set f to (POSIX file posixPath) as alias
import f
end repeat
end tell
end run
APPLESCRIPT
import_rc=$?
if [[ "$import_rc" -ne 0 ]]; then
log "ERROR: Photos import failed (osascript exit $import_rc). Keeping HEIC/HEIF files for retry."
exit 2
fi
log "Photos import succeeded. Deleting ${#heics[@]} imported HEIC/HEIF file(s) from disk."
for f in "${heics[@]}"; do
rm -f -- "$f"
done
log "Done."