OpenEXR color data is incorrect when using HalfVector4
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
- Ambito
- computer-graphics
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
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
DEBUGandRELEASEmode - 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SixLabors/ImageSharp
-
needs triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
SixLabors/ImageSharp#3198 · 1 commento ·
-
Grayscale Icc profile color Apertabug metadata:icc
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
SixLabors/ImageSharp#3197 ·
-
formats:exr
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
SixLabors/ImageSharp#3116 · 2 commenti · 1 reazione ·
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 52/100
SixLabors/ImageSharp#2805 · 1 commento ·
-
CR2: System.NotSupportedException: Missing SOI marker offset for tiff with old jpeg compression Apertaneeds triage
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
SixLabors/ImageSharp#2665 · 2 commenti ·
Tutte le issue di SixLabors/ImageSharp
Issue simili
-
bug needs response
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Adyen/adyen-dotnet-api-library#1869 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
difficulty/starter 🚀 good first issue kind/bug platform/ios 🍎 project/non-ui ⚙️ triage/untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
unoplatform/uno#24650 ·
-
area-ai untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dotnet/extensions#7783 ·
-
untriaged
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
dotnet/dotnet-api-docs#13095 ·