[x3d-public] ignore or respect color/gamma profiles embedded in images ?

Andreas Plesch andreasplesch at gmail.com
Fri Aug 18 09:29:04 PDT 2023


Short version:

Since X3D applies embedded ICC profiles through the underlying system
and glTF ignores it, there is a problem with glTF rendering in X3D:

https://github.com/create3000/x_ite/issues/144

The only solution may be to add a colorspaceConversion field to textures.

Feasible ? Other solutions ? Not a problem ?

Long version:

Some image format such as jpg or png can embed an ICC color profile
which lets one interpret the color data as an actual perceived color
in terms of the electromagnetic spectrum:

https://en.wikipedia.org/wiki/ICC_profile

This belongs to the field of color management which I think has the
goal that it should be possible to calibrate systems such that the
same color looks the same on a diversity of media, such as TVs,
monitors, AMOLED screens, projected on a wall or printed on glossy
paper. This is difficult but achievable with a lot of effort. (But I
think often it is ignored because without this effort results in
attempted color management can look worse.)

X3D seems to be silent on if and how such embedded color profiles
should be used for rendering on devices or printing. Is that the case
? X3D references image standards but the image standards only specify
how such profiles are embedded and not how the result should look like
in outputs.

Given the problem It is very reasonable that X3D's approach seems to
be that how the final color is rendered is left to the imaging system.

x3dom and I think also x_ite defer to image file processing by the
underlying system (browser, webgl) on how such embedded IC color
profiles are used.

However, glTF got more involved and made the decision that such
embedded ICC or gamma profiles should be always ignored for
processing. I think this is because textures go through a lot of
processing in shaders, and for consistent output you need predictable
input unaffected by uncertain system color processing.

Since X3D applies ICC profiles through the underlying system and glTF
ignores it, there is a problem with glTF color rendering in X3D:

https://github.com/create3000/x_ite/issues/144

The solution would be to add a SFBool colorspaceConversion field to
textures which toggles processing of embedded profiles. Another name
for the field could be "glTFMode" in case it needs to control other
texture related settings as well.

Would such a flag be feasible to implement in other browsers ? Is it
too obscure in its intention ?

The field could presumably only be accessible to glTF inlines, and not
exposed to X3D in general, as an implementation detail.

Now, the test glTF asset in the issue and the image used in the
comments have unrealistic, extreme ICC profiles which is not a fair
representation. But there is a problem if pixel accurate glTF
rendering with exact colors is a goal.

-Andreas

-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list