Skip to content

fix: draw 8-bit RGB GeoTIFFs as-is instead of re-stretching them - #21

Merged
TommySquared merged 1 commit into
mainfrom
fix/rgb-uint8-display-ready
Oct 26, 2026
Merged

TommySquared merged 1 commit into
mainfrom
fix/rgb-uint8-display-ready

Conversation

@TommySquared

Copy link
Copy Markdown
Collaborator

Summary

process_geotiff_rgb applied a per-band 2–98% percentile stretch to every RGB GeoTIFF, including 8-bit files that are already display-scaled: true-colour products, or writers that applied their own fixed reflectance stretch. The scene then set the colours. On a mostly-ocean image the stretch fitted the ocean, amplifying its noise into texture and shifting the colour balance, while a static PNG of the same file looked normal.

Change

  • 8-bit (uint8) RGB keeps its values.
  • Nodata, mask and alpha handling is unchanged.
  • Other data types are stretched exactly as before.

Tests

server/tests/test_geotiff_masking.py:

  • A dark, display-scaled uint8 scene keeps its values (ocean stays at 12 instead of being stretched to mid-grey), with nodata transparent.
  • A uint16 scene is still stretched.

The rest of the suite matches main (same pre-existing failures/errors in the MCP and screenshot harness).

🤖 Generated with Claude Code

process_geotiff_rgb applied a per-band 2-98% percentile stretch to every
RGB GeoTIFF, including 8-bit ones that are already display-scaled (a
true-colour product, or a writer that applied its own fixed reflectance
stretch). The scene then set the colours: on a mostly-ocean image the
stretch fitted the ocean, amplifying its noise into texture and shifting
the colour balance, while a static PNG of the same file looked normal.

uint8 RGB now keeps its values; nodata/mask/alpha handling is unchanged
and NaN-free. Other dtypes are stretched as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@TommySquared
TommySquared merged commit 08df0a9 into main Oct 26, 2026
3 checks passed
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