PNG: write cHRM and gAMA when cICP can't describe the color space
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
The issue points to ColorConfig::get_chromaticities() and get_transfer_function_gamma() from #5521 and #5557, plus the PNG, DPX, RLA, and Targa writers; it does not name source files or tests. First read those property changes and inspect how the writers currently choose color metadata. Agree on the two proposed behaviors before implementing; done means the agreed metadata is written safely and the read-back limitations described here are accounted for.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Now that ColorConfig::get_chromaticities() and
get_transfer_function_gamma() exist (#5521, #5557), the PNG writer could use
them for color spaces its cICP chunk can't describe. Before writing the PR, I'd
like to agree on two behavior changes, because each changes what files carry
and how they read back.
What happens today. Writing a gray PNG from each of these color spaces with
OCIO's default config, and reading it back:
| Written as | The file carries | Reads back as |
|---|---|---|
lin_p3d65_scene, srgb_p3d65_scene |
cICP | the same |
lin_ap1_scene |
gAMA 1.0 |
lin_rec709_scene |
g22_ap1_scene, g22_adobergb_scene |
nothing | srgb_rec709_scene |
lin_adobergb_scene, lin_ap0_scene |
nothing | srgb_rec709_scene |
So a file written from ACEScg reads back as linear Rec.709, and one written from
gamma 2.2 AdobeRGB as sRGB.
Proposal 1: PNG writes cHRM and gAMA when cICP can't describe the space.
When there is no cICP code and no ICC profile, the writer would take the
primaries from get_chromaticities() and a pure power from
get_transfer_function_gamma(), and write cHRM beside gAMA:
- only together: primaries without a transfer function would be half a
description, so a log or piecewise curve still gets no chunk; - not for Rec.709 primaries, where gAMA alone already says everything;
- not for primaries cHRM can't store: it holds no negative or zero
coordinate, so ACES AP0 (blue y is negative) is lost, with a debug message; - not for primaries the libPNG in use refuses. Older libPNG releases reject
some valid ones, such as ACES AP1's red (x + y > 1), and that rejection
aborts the write, so the writer would check them on a scratch structure
first.
ACEScg, gamma 2.2 AP1, AdobeRGB and the other spaces above would then carry
their primaries, which browsers and image editors honor.
Proposal 2: writers tag any linear color space as gamma 1.0. Today the gamma
that PNG, DPX, RLA and Targa write is 1.0 only for lin_rec709_scene and names
equivalent to "linear" or "scene_linear". With get_transfer_function_gamma(),
any color space with a linear transfer function would get 1.0, so linear
AdobeRGB or ACES2065-1 would no longer write no gamma at all.
The catch: reading back. OpenImageIO's PNG reader ignores cHRM today, so
these files would still read back with Rec.709 primaries in OpenImageIO, now
with the right transfer function. #5516 proposes reading cHRM and gAMA as
metadata. DPX, RLA and Targa have no field for primaries, so a linear ACEScg
DPX would read back as linear Rec.709 (as a linear ACEScg PNG already does).
Questions
- Should PNG write cHRM before OpenImageIO's own reader reads it? Other
readers would interpret these files correctly right away. - Is gamma 1.0 with unstated primaries better than no gamma for linear color
spaces in DPX, RLA and Targa?
These would be the first in-tree users of the properties #5521 added.
Assisted-by: Claude Code / Claude Opus 5.5
- Lingua principale
- C++
- Stelle
- 2.4k
- Fork
- 716
- Merge medio
- 2g 9h
- PR unite (30g)
- 91
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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 AcademySoftwareFoundation/OpenImageIO
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
AcademySoftwareFoundation/OpenImageIO#5619 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
AcademySoftwareFoundation/OpenImageIO#5570 ·
I maintainer di solito rispondono entro 1 giorno
-
define which color metadata OpenImageIO trusts, and when it resolves itForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
AcademySoftwareFoundation/OpenImageIO#5516 ·
I maintainer di solito rispondono entro 1 giorno
-
recognize configured color spaces and report their primaries and gammaForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
AcademySoftwareFoundation/OpenImageIO#5514 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
AcademySoftwareFoundation/OpenImageIO#5510 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di AcademySoftwareFoundation/OpenImageIO
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement Ready for final check
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
mpogue2/SquareDesk#1818 · 1 commento ·
-
launch-client --save-creds creates creds/<account>/ with mode 755, not 700Forse già presa @metis-sprock l’ha presa oggi. Apertabacklog bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
EchoTools/nevr-runtime#1471 ·
I maintainer di solito rispondono entro 1 giorno
-
docs: Page not found?Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
iamankushpandit/Gume#231 ·
I maintainer di solito rispondono entro 1 giorno