RepositoryPythonATAustria
fabianwimberger

fabianwimberger/immich-convert-originals

Batch-transcode Immich libraries to JPEG XL, HEIC, or AVIF (images) and AV1 (video). Save 30-50% storage. Preserves metadata & albums.

87stars
8forks
1issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: video-encoding

#1 Repository of the week

1
TINIX TRENDING·Topic: jpeg-xl

#1 Repository of the week

1
TINIX TRENDING·Topic: image-conversion

#1 Repository of the week

Immich Library Converter

CI codecov Docker License: MIT

Disclaimer: This is an independent, community-created project. It is not affiliated with, endorsed by, or sponsored by Immich. "Immich" and its associated logos are trademarks of their respective owners. Use of the name is solely for identification and compatibility purposes. Use at your own risk.

A self-hosted, web-based tool that batch-transcodes your Immich library to modern, space-efficient formats:

  • Images → JPEG XL, HEIC, or AVIF (your choice)
  • Videos → AV1 (MP4 container)

Browse your library, pick what to convert, and watch live progress in the browser — download, transcode, upload (or save locally instead), and remove the original only once the upload is verified.

Background

JPEG XL shrinks photos by 20-40% and AV1 shrinks videos by 30-50% with no visible quality loss. On a multi-TB Immich library that adds up fast.

DesktopMobile
Desktop web UI — asset browserMobile web UI

Features

  • Asset browser — filter by type, album, archived/deleted state; thumbnails are proxied through the backend, so the API key never reaches the browser
  • Run scoping — whole library, one album, a date range, or a selection from Browse
  • Image conversion — JPEG, PNG, WebP, HEIC, AVIF, TIFF, GIF, BMP → JPEG XL, HEIC, or AVIF; JPEG → JXL is a lossless bit-exact repack; input formats can be excluded from a run
  • Video conversion — MP4, MOV, MKV → AV1 (MP4)
  • Local-only mode — writes to <year>/<month> folders on disk instead of uploading, optionally keeping the original alongside; Immich is never touched
  • Metadata preservation — EXIF, GPS, favorite state, rating, and albums are copied to the replacement asset
  • Live and motion photos — the still is converted and stays linked to its video; motion photos with an embedded video (Google, Samsung, OnePlus) are stored as the still alone; re-encoding the video to AV1 is optional and off by default; local-only mode saves the video next to the still
  • Retry and resume — retries with more compression if the output is larger than the original; a later run skips assets already converted
  • Run history — per-asset outcomes for every run; retry only the failures or export them as CSV
  • Dry-run and live progress — preview what a run would do; progress arrives over WebSocket
  • Settings in the UI — connection, formats, quality, output mode, and retry behavior; no restart or .env file

Quick Start

Open http://localhost:8000 afterwards and enter the Immich URL and API key on the Settings page. The URL must include the /api suffix, e.g. https://photos.example.com/api.

Multi-arch image (linux/amd64, linux/arm64).

mkdir -p immich-converter/data && cd immich-converter
docker run -d \
  --name immich-library-converter \
  --restart unless-stopped \
  -p 8000:8000 \
  -v ./data:/app/data \
  ghcr.io/fabianwimberger/immich-convert-originals:latest

Create data/ yourself as shown: Docker creates a missing bind-mount source as root, and the container runs as uid 1000.

Option 2: Docker Compose (Build Locally)

git clone https://github.com/fabianwimberger/immich-convert-originals.git
cd immich-convert-originals
mkdir -p data
docker compose up -d

Option 3: Local Development

Needs ffmpeg, ImageMagick with the JXL and HEIC/AVIF delegates, libjxl-tools, and exiftool on the host.

uv sync --extra dev

FRONTEND_DIR=./frontend \
DATABASE_PATH=./data/app.db \
TEMP_DIR=./data/temp \
.venv/bin/uvicorn app.main:app --app-dir backend --reload --port 8000

How It Works

flowchart LR
    A[Browse / filter library] --> B[Start a run]
    B -->|download| C[Original asset]
    C --> D{Type}
    D -->|Image| E[Image encode<br/>JXL / HEIC / AVIF]
    D -->|Video| F[AV1 encode]
    E --> K{Output mode}
    F --> K
    K -->|Upload| G[Upload new asset]
    K -->|Local| L[Write to local disk]
    G --> H[Copy metadata<br/>EXIF, GPS, albums]
    H --> I[Delete original]
    I -.->|live progress| J[Browser via WebSocket]
    L -.->|live progress| J

Each asset is downloaded to a per-run temporary directory, transcoded (skipped if it is already in the target format), and validated; an output larger than the input is retried with more compression.

In upload mode the new asset is uploaded, its metadata is copied, and the upload is verified. Only then is the original deleted, which moves it to Immich's trash for 30 days. In local mode the file is written to <local output dir>/<year>/<month>/ and nothing in Immich changes.

If any step fails, the new asset is cleaned up and the original is preserved. The outcome is recorded either way, so a failed run shows up in History with the exact error.

Configuration

Everything behavioral — Immich connection, encoding defaults, filters, output mode — is configured from the Settings page in the web UI, no restart required. The only environment variables the app reads are infrastructure that has to exist before the database is reachable, and none of them need to be set for a normal install:

VariableDescriptionDefault
DATABASE_PATHPath to the app's SQLite database (settings + run history)/app/data/app.db
TEMP_DIRScratch directory for in-flight downloads/transcodes/app/temp
LOG_LEVELLog verbosityINFO
CORS_ORIGINSComma-separated origins allowed to call the APIhttp://localhost:8000,http://127.0.0.1:8000

Security & Safety

USE AT YOUR OWN RISK. In upload mode this tool deletes originals after conversion (recoverable via Immich trash for 30 days) — always back up first and test on a small selection before converting a whole library. The web UI has no built-in authentication — it's intended for a trusted home network or behind your own reverse-proxy auth; don't expose it directly to the internet.

Troubleshooting

SymptomCause / fix
Connection test fails with a 404The Immich URL must point at the API root and include the /api suffix, e.g. http://immich:2283/api or https://photos.example.com/api.
Connection test or uploads fail with 401/403The API key is missing a needed scope. Create it with asset read and asset upload permissions in Immich → Account Settings → API Keys; a read-only key authenticates but fails on upload.
Assets shared by a partner are skippedThey belong to another account, so the API key can't replace them in upload mode; they're skipped instead of failing. Local output mode can still convert them.
External library assets are skippedAn upload can't be written into an external library's folder. Use local output mode, or enable Convert external library assets in Settings → Output: the converted file then moves into Immich's own storage and the original is deleted from the external folder when Immich empties its trash.
Permission denied writing to /app/dataThe container runs as uid 1000, but a bind-mount source created by Docker is root-owned. Create the host data/ directory yourself before the first run (mkdir -p data).
Transcode fails with a codec or delegate errorLocal runs need ffmpeg, ImageMagick with the JXL/HEIC/AVIF delegates, libjxl-tools, and exiftool on the host. Use the Docker image to avoid host codec gaps.

Docker Image Tags

Images are available from ghcr.io/fabianwimberger/immich-convert-originals. Use latest for the latest release, or pin to a release tag (v2, v2.0, v2.0.0).

License

MIT License — see LICENSE file.

Third-Party Licenses

ComponentLicenseSource
libjxlBSD-3-Clausehttps://github.com/libjxl/libjxl
FFmpegGPL-2.0+ (Alpine build links x264/x265)https://ffmpeg.org/
libheifLGPL-3.0+https://github.com/strukturag/libheif
ImageMagickApache-2.0https://imagemagick.org/
ExifToolArtistic/GPLhttps://exiftool.org/
FastAPIMIThttps://fastapi.tiangolo.com/
SQLAlchemyMIThttps://www.sqlalchemy.org/

This app invokes these as separate subprocesses and never links against them, so none of the above affects this project's own MIT license. See DOCKER_LICENSES.md for the full codec library breakdown (x264, x265, libaom, dav1d, rav1e, SVT-AV1) and what GPL/LGPL requires of anyone distributing the image.

Similar Projects

Discover other similar projects and AI models.

RepositoryC#
d2phap/ImageGlass

🏞 A fast, open-source, modern image viewer for 90+ formats – including WEBP, GIF, SVG, AVIF, JXL, HEIC and more – built for smooth browsing across Windows, macOS, and Linux.

15.1k
Nov 30, 2026
RepositoryC++
jark006/JarkViewer

一款简约且飞快的看图软件,支持 AVIF、HEIC、JPEG-XL 和 实况照片 等超多新兴图像格式!A minimalist and lightning-fast image viewer that supports a wide range of emerging image formats such as AVIF, HEIC, JPEG-XL, and Live Photos!

1.4k
Nov 1, 2026
RepositoryC++
Tom94/tev

High dynamic range (HDR) image viewer for people who care about colors

1.5k
Nov 26, 2026
RepositoryC++
sanxchep/licasa

Open-source image viewer and editor for Linux. View HEIC, AVIF, JPEG XL, RAW previews, and Motion Photos in fullscreen or floating windows.

153
Nov 22, 2026
RepositoryC++
awxkee/avif-coder

AVIF/HEIC coder for Android, Kotlin, Java

116
Nov 15, 2026
RepositoryRust
Blobfolio/refract

A guided AVIF/JPEG XL/WebP conversion utility for JPEG and PNG sources.

100
Nov 24, 2026
RepositoryJava
gotson/NightMonkeys

Additional plug-ins and extensions for Java's ImageIO using native libraries

74
Nov 2, 2026
RepositoryC#
loliri/Starshot

Next-generation Windows-native HDR screenshot tool — full 16-bit HDR pipeline, region snipping / clipboard history / OCR / AVIF·JXL·PNGv3 encoding / color management, natively built on WinUI 3. / 新一代 Windows HDR 截图工具,16bit 全链路捕获,区域截图 / 剪贴板历史 / 文字识别 / AVIF·JXL·PNGv3 编码 / 色彩管理,基于 WinUI 3 原生构建。

73
Nov 26, 2026
RepositoryTypeScript
immich-app/immich

High performance self-hosted photo and video management solution.

120.6k
Dec 1, 2026