Skip to content

Fix color limit inversion support for image export #445

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

Merged

Conversation

roche-emmanuel
Copy link
Contributor

@roche-emmanuel roche-emmanuel commented Apr 1, 2025

Hi @ameraner , @strandgren , @sjoro ,

This PR provides the required fixes for issue #333:

To support the "color bar inversion" while generating the exported image we simply need to always map our color limit min/max values appropriately (ie. irrespectively of the name "vmax/vmin" that we use for those values): this part of the fix is included in the export_image.py file.

Now, on a similar not, in the layer_details.py conversions between QT physical units and dataset value units were not always properly taking into account that what we call "valid_max"/"valid_min" could also be inverted. So I introduced a few changes in that file too.

=> Overall, the image export feature now seems to work as expected for me with those changes. But of course, please let me know if you think there is anything we need to discuss/change before the PR can be accepted. Thanks 🙏!

Closes #333

@RudiLauster
Copy link
Contributor

Hello Andrea @ameraner, hello Manu @roche-emmanuel,

I also took a look at this PR using a FCI L1 product and could reproduce that the bug is gone! 👍🙂👍

Besides:
Andrea, I found two issues that are not really related to this bug and I wonder if they have already been detected: I loaded two layers and found out that only the colour bar of one of the loaded layers is exported into the image.
No matter what layer I select, always only this one colour bar is in the image.
Also I selected a radiance map and the colour bar scale is crowded and unreadable in the image exported.
Both of those issues are already on the master, so again, have nothing to do with this PR.

@ameraner ameraner changed the title Issue #333: Fixing color limit inversion support for image export Fix color limit inversion support for image export Apr 14, 2025
@ameraner ameraner added the bug Something isn't working label Apr 14, 2025
Copy link
Collaborator

@ameraner ameraner left a comment

Choose a reason for hiding this comment

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

LGTM and works well, thanks!

@ameraner ameraner merged commit ac14a0e into ssec:master Apr 14, 2025
13 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export Image with Colorbar : colorbar doesn't flip when enhancement flips
3 participants