Skip to content

Add L32F and La32F to ExtendedColorType#2793

Merged
197g merged 1 commit into
image-rs:mainfrom
RunDevelopment:ext-color-L32
Feb 26, 2026
Merged

Add L32F and La32F to ExtendedColorType#2793
197g merged 1 commit into
image-rs:mainfrom
RunDevelopment:ext-color-L32

Conversation

@RunDevelopment
Copy link
Copy Markdown
Member

Related to #1940

This PR adds variants to ExtendedColorType for representing single-channel and dual-channel float32 colors: L32F and La32F respectively. These color types are not uncommon and should at least be representable in image. Adding them to ColorType would be nice too, but likely much more complex due to the symmetry with DynamicImage. I added them ExtendedColorType because this type seems more open to change and enables additional functionality (such as saving images).

This addition also closes some gaps in existing APIs. Since ExtendedColorType can now represent the pixel types Luma<f32> and LumaA<f32>, the PixelWithColorType trait can be implemented for all color x primitive combinations. Because of this, ImageBuffer<Luma<f32>, _> and ImageBuffer<LumaA<f32>, _> can now use the save* and write* methods.

Of course, no encoder currently supports L32F or La32F, but this can easily be added in follow-up PRs. In particular, supporting L32F in TIFF and HDR should be relatively easy. And of course, I want to support L32F for DDS too.

@197g 197g merged commit cdcc830 into image-rs:main Feb 26, 2026
31 checks passed
@RunDevelopment RunDevelopment deleted the ext-color-L32 branch February 27, 2026 15:40
@197g 197g moved this from Gif to Tiff in glycin-compat May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Tiff

Development

Successfully merging this pull request may close these issues.

3 participants