Previews and thumbnails for HEIC HDR images look flat #5656

Open
opened 2026-02-20 04:03:18 -05:00 by deekerman · 7 comments
Owner

Originally created by @leolabs on GitHub (May 26, 2025).

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

I usually take pictures using a Sony A7C II which I edit in Photomator and export as HDR HEIC files. When viewing these files in Preview on macOS, they look great on both HDR and non-HDR capable displays. However, when I import them into Immich, the thumbnails look washed out, like they're missing some kind of tone mapping.

Here's a comparison using the following file: https://filedn.eu/lzxyiPUpTfXyGSc90YOvYiX/immich/issues/photomator-hdr.heic

Image

The left side shows Immich's generated preview, and the right side shows the same file in macOS's Preview app.

I've tried the same using an HDR JPG file of the same picture, which seems to work better: https://filedn.eu/lzxyiPUpTfXyGSc90YOvYiX/immich/issues/photomator-hdr.jpg

Image

This issue does not occur when uploading HDR HEIC images created from an iPhone camera, so it might have to do with differences in the pictures' metadata. The HEIC images taken with my iPhone are also in 8-bit with 3 channels while the exported HEIC images from Photomator are in 10-bit with 4 channels (RGBA maybe?).

Thank you in advance for looking into this!

The OS that Immich Server is running on

TrueNAS Scale

Version of Immich Server

v1.132.3

Version of Immich Mobile App

irrelevant

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich
services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    networks:
      internal: null
      macvlan_network:
        ipv4_address: 192.168.1.248
    devices:
      - /dev/dri:/dev/dri
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false
  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    networks:
      internal: null
    device_cgroup_rules:
      - c 189:* rmw
    devices:
      - /dev/dri:/dev/dri
    volumes:
      - model-cache:/cache
      - /dev/bus/usb:/dev/bus/usb
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false
  redis:
    container_name: immich_redis
    image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8
    networks:
      internal: null
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always
  database:
    container_name: immich_postgres
    image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
    networks:
      internal: null
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: --data-checksums
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    healthcheck:
      test: pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" ||
        exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}"
        --username="$${POSTGRES_USER}" --tuples-only --no-align
        --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM
        pg_stat_database')"; echo "checksum failure count is $$Chksum"; [
        "$$Chksum" = '0' ] || exit 1
      interval: 5m
      start_interval: 30s
      start_period: 5m
    command: postgres -c shared_preload_libraries=vectors.so -c
      'search_path="$$user", public, vectors' -c logging_collector=on -c
      max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on
    restart: always
volumes:
  model-cache: null
networks:
  internal: {}

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/M2/Media/Immich/library
# The location where your database files are stored
DB_DATA_LOCATION=/mnt/M2/Containers/immich/postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

Reproduction steps

  1. Upload the provided HEIC file to your Immich library
  2. Wait for the thumbnails and previews to be generated
  3. See that the preview and thumbnail are washed out

Relevant log output


Additional information

No response

Originally created by @leolabs on GitHub (May 26, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug I usually take pictures using a Sony A7C II which I edit in Photomator and export as HDR HEIC files. When viewing these files in Preview on macOS, they look great on both HDR and non-HDR capable displays. However, when I import them into Immich, the thumbnails look washed out, like they're missing some kind of tone mapping. Here's a comparison using the following file: https://filedn.eu/lzxyiPUpTfXyGSc90YOvYiX/immich/issues/photomator-hdr.heic ![Image](https://github.com/user-attachments/assets/62b5ceac-73dc-4183-af98-4c1536ea5e1d) The left side shows Immich's generated preview, and the right side shows the same file in macOS's Preview app. I've tried the same using an HDR JPG file of the same picture, which seems to work better: https://filedn.eu/lzxyiPUpTfXyGSc90YOvYiX/immich/issues/photomator-hdr.jpg ![Image](https://github.com/user-attachments/assets/9f800a4a-bece-435b-875b-8ba338925549) This issue does not occur when uploading HDR HEIC images created from an iPhone camera, so it might have to do with differences in the pictures' metadata. The HEIC images taken with my iPhone are also in 8-bit with 3 channels while the exported HEIC images from Photomator are in 10-bit with 4 channels (RGBA maybe?). Thank you in advance for looking into this! ### The OS that Immich Server is running on TrueNAS Scale ### Version of Immich Server v1.132.3 ### Version of Immich Mobile App irrelevant ### Platform with the issue - [x] Server - [x] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose # # Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} networks: internal: null macvlan_network: ipv4_address: 192.168.1.248 devices: - /dev/dri:/dev/dri volumes: # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env depends_on: - redis - database restart: always healthcheck: disable: false immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} networks: internal: null device_cgroup_rules: - c 189:* rmw devices: - /dev/dri:/dev/dri volumes: - model-cache:/cache - /dev/bus/usb:/dev/bus/usb env_file: - .env restart: always healthcheck: disable: false redis: container_name: immich_redis image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8 networks: internal: null healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52 networks: internal: null environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: --data-checksums volumes: # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file - ${DB_DATA_LOCATION}:/var/lib/postgresql/data healthcheck: test: pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')"; echo "checksum failure count is $$Chksum"; [ "$$Chksum" = '0' ] || exit 1 interval: 5m start_interval: 30s start_period: 5m command: postgres -c shared_preload_libraries=vectors.so -c 'search_path="$$user", public, vectors' -c logging_collector=on -c max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on restart: always volumes: model-cache: null networks: internal: {} ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/M2/Media/Immich/library # The location where your database files are stored DB_DATA_LOCATION=/mnt/M2/Containers/immich/postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich ``` ### Reproduction steps 1. Upload the provided HEIC file to your Immich library 2. Wait for the thumbnails and previews to be generated 3. See that the preview and thumbnail are washed out ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@maddog107 commented on GitHub (May 28, 2025):

I have this same issue. All the thumbnails are washed out, but if I download the original and look at it, it looks great. Maybe we can do the thumbnails in webp/heif instead of jpg if jpg doesn't support the HDR?

My pictures are taking from a Canon R6 Mark II

@maddog107 commented on GitHub (May 28, 2025): I have this same issue. All the thumbnails are washed out, but if I download the original and look at it, it looks great. Maybe we can do the thumbnails in webp/heif instead of jpg if jpg doesn't support the HDR? My pictures are taking from a Canon R6 Mark II
Author
Owner

@linkion commented on GitHub (Jun 1, 2025):

Having this same issue with Canon EOS R50, shooting with HDR PQ mode

Image
@linkion commented on GitHub (Jun 1, 2025): Having this same issue with Canon EOS R50, shooting with HDR PQ mode <img width="1440" alt="Image" src="https://github.com/user-attachments/assets/146879c2-83d6-4478-b929-d2646888d035" />
Author
Owner

@HansDP-source commented on GitHub (Jun 2, 2025):

Hallo, i have now loaded HEIC photos from the iPhone in Immich via web and via mobile. I also created an album in the photo app and provided photos to back up in immich. Unfortunately, the same reason for each of these variants is always the same reason. HDR we are not shown after uploading in immich. Is there a configuration setting that I may have to consider?
Pictures which I captured via Nikon D780 and then exported via Photoshop in AVIF (HDR) and imported them in immich unfortunately show the same result, no HDR.
Thanks in advance for the support!
Hans

Good evening,
it didn't leave me any peace. I think I've found an interim solution. However, this does not refer to the preview images, but to the full-screen display. When you call up, only a washed image is displayed. But if you click on the "+" (enlarge) the full HDR image will be displayed after a short time. Unfortunately, this is not a long time, but perhaps this is a starting point for troubleshooting.

@HansDP-source commented on GitHub (Jun 2, 2025): Hallo, i have now loaded HEIC photos from the iPhone in Immich via web and via mobile. I also created an album in the photo app and provided photos to back up in immich. Unfortunately, the same reason for each of these variants is always the same reason. HDR we are not shown after uploading in immich. Is there a configuration setting that I may have to consider? Pictures which I captured via Nikon D780 and then exported via Photoshop in AVIF (HDR) and imported them in immich unfortunately show the same result, no HDR. Thanks in advance for the support! Hans Good evening, it didn't leave me any peace. I think I've found an interim solution. However, this does not refer to the preview images, but to the full-screen display. When you call up, only a washed image is displayed. But if you click on the "+" (enlarge) the full HDR image will be displayed after a short time. Unfortunately, this is not a long time, but perhaps this is a starting point for troubleshooting.
Author
Owner

@Starbix commented on GitHub (Jun 4, 2025):

This is the same problem as in https://github.com/immich-app/immich/discussions/8284.
Basically the HEIC you provide is a "pure" HDR file, meaning it's not an SDR file with a gain map slapped on top of it (like HDR JPG files). That's also the reason iOS HEIF files look fine as they're also using gainmaps.
Your picture has Transfer Characteristics "SMPTE ST 2084, ITU BT.2100 PQ", signalled by the NCLX tag. Unfortunately, libvips, the upstream image library, doesn't support fully support taking into account the NCLX tag when converting to SDR. So this is not an Immich issue.
Unfortunately there's not much you can do at the moment, apart from waiting for a libvips update (could take a while) or using gain map based HDR files.

@Starbix commented on GitHub (Jun 4, 2025): This is the same problem as in https://github.com/immich-app/immich/discussions/8284. Basically the HEIC you provide is a "pure" HDR file, meaning it's not an SDR file with a gain map slapped on top of it (like HDR JPG files). That's also the reason iOS HEIF files look fine as they're also using gainmaps. Your picture has Transfer Characteristics "SMPTE ST 2084, ITU BT.2100 PQ", signalled by the NCLX tag. Unfortunately, libvips, the upstream image library, doesn't support fully support taking into account the NCLX tag when converting to SDR. So this is not an Immich issue. Unfortunately there's not much you can do at the moment, apart from waiting for a libvips update (could take a while) or using gain map based HDR files.
Author
Owner

@akavkl commented on GitHub (Aug 9, 2025):

I uploaded a JPEG-R image via both the Android app and the web, just to be sure. The thumbnails indeed lose the HDR gainmap present in the original image.
When zoomed in, Immich loads the original image, and the HDR works as intended.
So the generated thumbnails do not include the HDR metadata for either 'Pure' HDR or 'Gainmap' HDR.

@akavkl commented on GitHub (Aug 9, 2025): I uploaded a JPEG-R image via both the Android app and the web, just to be sure. The thumbnails indeed lose the HDR gainmap present in the original image. When zoomed in, Immich loads the original image, and the HDR works as intended. So the generated thumbnails do not include the HDR metadata for either 'Pure' HDR or 'Gainmap' HDR.
Author
Owner

@bvibber commented on GitHub (Dec 26, 2025):

I'm seeing the same problem with PQ HEIC files saved from a Canon EOS R10. They should be in BT.2020 colorspace with PQ transfer characteristics, and from what I see above Immich's dependencies don't support this yet. :(

@bvibber commented on GitHub (Dec 26, 2025): I'm seeing the same problem with PQ HEIC files saved from a Canon EOS R10. They should be in BT.2020 colorspace with PQ transfer characteristics, and from what I see above Immich's dependencies don't support this yet. :(
Author
Owner

@tvass commented on GitHub (Jan 11, 2026):

Thanks for opening the issue all. Same issue with Canon R7 default settings.

@tvass commented on GitHub (Jan 11, 2026): Thanks for opening the issue all. Same issue with Canon R7 default settings.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/immich#5656
No description provided.