Automatic Rescaling #661
vincentsarago
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
in rio-tiler https://github.com/cogeotiff/rio-tiler/blob/6d71e7d380cd815b8f65a1917653769d882c2aa6/rio_tiler/models.py#L732C10-L758
we automatically rescale the data IF ONLY we know the output format (e.g. PNG) will not work with the Image datatype (e.g. int32). We will rescale the array using either Min/Max from COG metadata or Datatype range (starting with 5.0, rio-tiler will also use STAC statistics extension).
This is really useful to make sure we always return images, and if using statistics, to return meaningful image. This could be extended to always rescale the image
form
titiler/src/titiler/core/titiler/core/factory.py
Lines 553 to 560 in 047453f
to something like
cc @matthewhanson
Beta Was this translation helpful? Give feedback.
All reactions