Skip to content

Incorrect 16-bits textures color space #3429

Description

@Meakk

Describe the bug
When a color texture is attached to a material, the texture is flagged as sRGB encoded.
However, sRGB format is only supported on 8-bits RGB(A) formats so the flag is ignored on 16-bits textures.

To Reproduce
Steps to reproduce the behavior:

  1. Open the file using f3d --no-config testing/data/16bit.png
  2. Compare colors with another image viewer

Expected behavior
A new vtkF3DLinearColorSpaceFilter should be added and plugged between the image reader and vtkTexture when sRGB format is requested.
The filter should be a no-op for types other than VTK_SHORT and VTK_UNSIGNED_SHORT.
Internally, the channel should be converted to a float (e.g. by dividing by 65535 for unsigned shorts), apply the formula pow(value, 2.2), and convert back to it's original type.

System Information:

N/A

F3D Information
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status
    Discuss

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions