Repository navigation
feat(geotiff): Add colorinterp property - #317
Merged
Merged
Conversation
# Conflicts: # packages/geotiff/src/ifd.ts
kylebarron
enabled auto-merge (squash)
July 10, 2026 18:32
This was referenced Jul 10, 2026
kylebarron
added a commit
that referenced
this pull request
Oct 16, 2026
…unt (#732) > [!NOTE] > This PR was written by Claude (Claude Code), not by @kylebarron. The default COG pipeline drew the fourth band of any 4-band RGB image as alpha. NAIP's fourth band is near-infrared (ExtraSamples 0, "unspecified"), so water and shadows, which reflect little near-infrared, were drawn see-through. A gray+alpha image lost its alpha instead: its two-channel texture samples the alpha band into `color.g`, and `BlackIsZero` or `WhiteIsZero` then writes the gray value over it. The pipeline now decides from the bands' color interpretation (#317): - An RGB image whose fourth band isn't alpha is drawn opaque, with a new `Opaque` module. - A gray image whose second band is alpha gets a new `GrayAlpha` module, which moves that band into alpha before the gray-to-RGB module runs. - RGBA images, and gray images whose second band isn't alpha, are drawn as before. Both modules are exported from `@developmentseed/deck.gl-raster/gpu-modules`, next to `BlackIsZero` and the other color modules. `colorInterp` now counts associated (premultiplied) alpha as alpha, as GDAL does; it counted only unassociated alpha. Without this, the pipeline would have drawn associated-alpha images opaque. Their color is still not un-premultiplied, as before. `ColorInterp` is now exported from `@developmentseed/geotiff`, since the public `colorInterp` getter returns it. Checked in Chrome with cog-basic, temporarily pointed at a 4-band NAIP COG and at a gray+alpha COG whose left half has alpha 0. Before, the NAIP reservoir showed the basemap's water through the image and the gray image's transparent half was drawn; after, the reservoir is opaque and that half is transparent. The 3-band NAIP COG already in cog-basic renders pixel-identical before and after. Closes #187, closes #361 🤖 Written by [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #300 ; a port of developmentseed/async-geotiff#105