You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the DDS, TGA, and WIC readers always expand P8 and A8P8 format images to RGBA32. This is the primary workflow, and makes sense as the default behavior. Most of the operations/functions in the library do not support paletted data by design. Direct3D 11 and Direct3D 12 do not support palette texture formats, although in theory you could implement them with a programmable shader.
I could make use of the DXGI enumerations DXGI_FORMAT_P8 and DXGI_FORMAT_A8P8 which were added for video support to return the data in the original paletted form.
This would also require some way to retrieve the palette data as well (like adding a palette member to Image).
Requesting this behavior on read rather than the current behavior to always expand the data would require some specific behavior flag (DDS_FLAGS_ALLOW_P8, TGA_FLAGS_ALLOW_P8, WIC_FLAGS_ALLOW_P8).
Writing would be indicated by giving an input image with DXGI_FORMAT_P8 or DXGI_FORMAT_A8P8.
If there was some reason to support this palette workflow, then it would be worth considering adding a codec for the PCX which is a classic paletted format.
"palette workflow" would also imply the need for explicit functions to convert P8/A8P8 to RGBA32, and a function for converting RGBA32 to a P8/A8P8 image using something like "median cut" (see this article).
The text was updated successfully, but these errors were encountered:
Trying to create new flag constants such as 'DDS_FLAGS_ALLOW_P8', 'TGA_FLAGS_ALLOW_P8', and 'WIC_FLAGS_ALLOW_P8'. These flags should be clearly defined in your library to indicate that the reder should allow for paletted formats.
Also, considering the addition of a codec for classic paletted formats like PCX seems like a great step as well. PCX would be suport various image formats.
Currently the DDS, TGA, and WIC readers always expand P8 and A8P8 format images to RGBA32. This is the primary workflow, and makes sense as the default behavior. Most of the operations/functions in the library do not support paletted data by design. Direct3D 11 and Direct3D 12 do not support palette texture formats, although in theory you could implement them with a programmable shader.
I could make use of the DXGI enumerations
DXGI_FORMAT_P8
andDXGI_FORMAT_A8P8
which were added for video support to return the data in the original paletted form.This would also require some way to retrieve the palette data as well (like adding a
palette
member toImage
).Requesting this behavior on read rather than the current behavior to always expand the data would require some specific behavior flag (
DDS_FLAGS_ALLOW_P8
,TGA_FLAGS_ALLOW_P8
,WIC_FLAGS_ALLOW_P8
).Writing would be indicated by giving an input image with
DXGI_FORMAT_P8
orDXGI_FORMAT_A8P8
.The text was updated successfully, but these errors were encountered: