Repository navigation
fix: draw 8-bit RGB GeoTIFFs as-is instead of re-stretching them - #21
Merged
Merged
Conversation
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>
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.
Summary
process_geotiff_rgbapplied 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
uint8) RGB keeps its values.Tests
server/tests/test_geotiff_masking.py:uint8scene keeps its values (ocean stays at 12 instead of being stretched to mid-grey), with nodata transparent.uint16scene 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