-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating-point image data range seems to be assumed to be at least 0-255. #4624
Comments
The heuristics here might need tweaking, and should probably be done in conjunction with actually exposing the image range in the UI, i.e.: The reason for the current default is that it is also quite common to load an image and then convert it to float (perhaps as a side-effect of something else). It would then be weird if Rerun showed the same image differently just because you converted bytes to floats. For instance: img = cv2.cvtColor(cv2.imread("img.png", cv2.IMREAD_UNCHANGED), cv2.COLOR_BGRA2RGB)
rr.log("img_1", rr.Image(img))
rr.log("img_2", rr.Image(img.astype("float32")))
rr.log("img_3", rr.Image(1.0 * img)
rr.log("img_4", rr.Image(0.5 * img) It's reasonable to expect the first three images to have the same appearance in Rerun. It it is also quite reasonable to expect the last two images to have a different apprearance ( |
That makes sense.
Several thoughts:
|
There will! This is part of our Blueprint work, where ultimately everything that can be specified in the GUI can also be specified at log time. |
…de) (#7549) ### What * Fixes #6106 * Fixes #2341 * NOT included here is image ranges, this PR is only about things affecting colormaps (#4624) Depth images (and their clouds): https://github.com/user-attachments/assets/949ffb14-38e9-452d-a84f-695104f146c8 Tensors: https://github.com/user-attachments/assets/eea3b38f-e4c7-4b97-9cc3-2fc6104ed6b7 Noteworth ripple effects & considerations in this PR: * turns out depth image constructor on Python missed a lot of parameters, fixed that * went with a new `ValueRange` component rather than reusing `Range1D` because the semantics (and names in the ui) of the later were just too unclear * we need a tagged component mechanism really badly! * decided against putting this on the tensor view as some notes indicated was the plan * ended up refactoring a few interesting things around image/tensor handling: * colormap is no longer part of `ImageInfo`, we already didn't use it for hashing it. Having now a range made it even more clear that this doesn't belong there * `finite_range` on tensor & image is now always present, using the datatypes' finite range as fallback. The `None` case handling was awkward at best and non-existant (error out) usually ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7549?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/7549?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/7549) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
Describe the bug
When an
archetypes::Image
is logged, if the pixel values do not reach at least 255.0, then none of them will be displayed with full brightness in the viewer. It seems that there is an auto-ranging/auto-exposure feature (logging very large values causes the rest of the image to darken) but it never uses a maximum less than 255.0.This is contrary to typical usage (in my personal experience in computer graphics and GIS) of floating-point pixel formats, where if there is an assumed 100% brightness value, then that value is 1.0.
To Reproduce
Steps to reproduce the behavior:
archetypes::Image
whosedata
contains adatatypes::TensorBuffer::F16
with values in the 0.0 - 1.0 range.Expected behavior
The auto-ranging should select a range that either matches the data, or has an assumed maximum of 1.0.
I'm not sure what would be best to do with the alpha component — which should generally not be auto-scaled since "opaque" is semantically different from "all X% transparent". I haven't investigated Rerun's current behavior with it.
Screenshots
Desktop (please complete the following information):
Rerun version
rerun-cli 0.11.0 [rustc 1.75.0 (82e1608df 2023-12-21), LLVM 17.0.6] x86_64-apple-darwin
The text was updated successfully, but these errors were encountered: