Skip to content

feat: Support grayscale photometric interpretation#179

Merged
kylebarron merged 5 commits intomainfrom
kyle/support-grayscale
Mar 5, 2026
Merged

feat: Support grayscale photometric interpretation#179
kylebarron merged 5 commits intomainfrom
kyle/support-grayscale

Conversation

@kylebarron
Copy link
Copy Markdown
Member

@kylebarron kylebarron commented Jan 12, 2026

Closes #175

Change list

  • Create new BlackIsZero and WhiteIsZero GPU shader modules
  • Ensure that typed array type matches what the GPU expects for the given texture format. This had been preventing uint16 images from rendering

uint8_1band_deflate_block128_unaligned_mask.tif from developmentseed/geotiff-test-data#50

image

And with uint16 1-band data https://github.com/developmentseed/geotiff-test-data/blob/7fa07ac10f9d54b2ac2e557117432cf8f2f80eef/rasterio_generated/fixtures/uint16_1band_scale_offset_info.md#L4

image

Copy link
Copy Markdown

@mdsumner mdsumner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions black_zero_to_rgb(float value) and white_zero_to_rgb(float value) expect a float, but color is a vec4.

@mdsumner
Copy link
Copy Markdown

that was tested in concert with PRs

#180 and #182

https://projects.pawsey.org.au/image-cogs/images/gebco_boxmerc_8192_UInt16.tif

created by

gdal_translate /vsicurl/https://projects.pawsey.org.au/idea-gebco-tif/GEBCO_2024.tif -scale -ot UInt16 -outsize 8192 4096 -of COG -co OVERVIEW_COUNT=3 /tmp/mycogs/gebco_8192_UInt16.tif
image

@kylebarron
Copy link
Copy Markdown
Member Author

The functions black_zero_to_rgb(float value) and white_zero_to_rgb(float value) expect a float, but color is a vec4.

Yes, I might not have pushed my last commit on this branch

@github-actions github-actions bot added the feat label Mar 5, 2026
@kylebarron kylebarron enabled auto-merge (squash) March 5, 2026 23:42
@kylebarron kylebarron merged commit cb612de into main Mar 5, 2026
6 checks passed
@kylebarron kylebarron deleted the kyle/support-grayscale branch March 5, 2026 23:42
@ds-release-bot ds-release-bot bot mentioned this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support grayscale (ZeroIsBlack)

2 participants