Skip to content

Add f16 color formats to ExtendedColorType#3030

Open
RunDevelopment wants to merge 1 commit into
image-rs:mainfrom
RunDevelopment:f16-extended-color
Open

Add f16 color formats to ExtendedColorType#3030
RunDevelopment wants to merge 1 commit into
image-rs:mainfrom
RunDevelopment:f16-extended-color

Conversation

@RunDevelopment

Copy link
Copy Markdown
Member

I split off f16 colors from #3015, because that PR might take a little.

Motivation

fp16 is already a common and widespread format for representing colors. It can losslessly represent 11-bit UNORM and has the ability to represent number outside the range 0-1. This makes it a great format for HDR content. Image formats that natively support fp16 are TIFF and DDS.

While Rust itself has yet to stabilize f16, there is value in adding these to ExtendedColorType even if we don't support de/encoding images with it right now. The main pro is that decoders can use these variants to accurately report the original color type. For example, DDS has the R16G16B16A16_FLOAT color type.

Description

I added L16F, La16F, Rgb16F, and Rgba16F to ExtendedColorType. They are placed last (but before Unknown(u8)) to not mess with serde.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant