Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

OpenEXR color data is incorrect when using HalfVector4

Aperta
#3,194 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start in ExrDecoderCore.cs around the pixel assignment using FromAssociatedScaledVector4, then inspect FromVector4 for the related floating-point formats. Reproduce with an OpenEXR file loaded as HalfVector4 or HalfVector4P and inspect ToVector4(); done means HDR channel values are preserved instead of being clamped and scaled.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs triage
Prerequisites
  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported
ImageSharp version

4.1.2

Other ImageSharp packages and versions

4.1.2

Environment (Operating system, version and so on)

windows11

.NET Framework version

10

Description

I encountered an issue where OpenEXR image data is being incorrectly altered during loading when using the HalfVector4 floating-point pixel formats

OpenEXR frequently stores High Dynamic Range (HDR) color data in floating-point formats, which means values often exceed the [0, 1] range. However, the current loading logic clamps and scales these values, destroying the original raw data.

I traced the issue to two specific areas in the codebase:
In ExrDecoderCore.cs (around line 225):
pixelRow[x] = TPixel.FromAssociatedScaledVector4(pixelValue);
If TPixel is HalfVector4 and the EXR pixel type is half or float, the RGB channels are clamped to [0, 1] and then scaled/biased to [FiniteMinimum, FiniteMaximum]. This breaks the original floating-point data. I believe the clamp and scale operations should be avoided here.

As a side note for other floating point pixel format like RgbaHalf and RgbaVector.The FromAssociatedScaledVector4 method calls FromVector4(Vector4 source). Inside FromVector4, the original values are explicitly clamped to [0, 1]. This also breaks the raw EXR data.

Steps to Reproduce

load a openEXR file in HalfVector4 or HalfVector4P format,then check the pixel value of ToVector4();

Images

No response

Lingua principale
C#
Stelle
8k
Fork
899
Merge medio
1g 5h
PR unite (30g)
7

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SixLabors/ImageSharp

Tutte le issue di SixLabors/ImageSharp

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.