Conversation
This reverts commit 02dbb84.
LynnSchmittwilken
approved these changes
May 27, 2026
LynnSchmittwilken
left a comment
Collaborator
There was a problem hiding this comment.
can you add a warning when values are being clipped, otherwise looks great and works for me!
|
|
||
| # Compute AABB, clip to canvas, query live tiles | ||
| y_min, x_min, y_max, x_max = leaf_mask_kw[self.leaf_shape].bbox(params) # pyright: ignore[reportCallIssue] | ||
| y_min, x_min, y_max, x_max = leaf_mask_kw[self.leaf_shape].bbox( |
Collaborator
There was a problem hiding this comment.
Minor, but why the line breaks?
Collaborator
Author
There was a problem hiding this comment.
With the comment the line was too long, so my auto-formatting changed it
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.
Closes #43 and #39
Hi Lynn,
This PR contains:
(1) Fix ValueErrors raised by
rgb_to_hsvwhen sampling colors outside [0,1](2) Fix demo notebook
(3) Small changes on readme and docs
The Problem in (1)
If the texture space is (H,S,V) we need to transform, the colors also need to be in (H,S,V) for adding the texture.
If colors are sampled with values outside [0,1] this causes problems since the clipping is only performed at rendering and
rgb_to_hsvproduces errors for value outside [0,1].Solution
We now clip before transformation to (H,S,V) and only transform if necessary if the color space is already (H,S,V) we use the original (H,S,V) values directly to avoid unnecessary back and forth transformation.
Validation
I added a test to check that multiple combinations of color and texture values and color spaces produce images without errors.