Skip to content

fix: int_image clips floating point data to 0 to 1 instead of letting it wrap - #325

Merged
petercorke merged 2 commits into
mainfrom
fix/int-image-clips-floats
Nov 27, 2026
Merged

petercorke merged 2 commits into
mainfrom
fix/int-image-clips-floats

Conversation

@petercorke

Copy link
Copy Markdown
Owner

int_image scaled floating point data by the integer maximum and cast it without clipping, so a value outside 0 to 1 wrapped to an unrelated pixel: 1.2 became 50 and -0.5 became 128 in uint8. Data in range is unchanged. The docstring explains the clipping, with an example.

An AI assistant (Claude Code) wrote this change.

🤖 Generated with Claude Code

… it wrap

A float of 1.2 became 50 and -0.5 became 128 in uint8, because the scaled
value was cast without a clip. The docstring now says values outside the
range are clipped, with an example.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@petercorke
petercorke merged commit b9e42ed into main Nov 27, 2026
34 checks passed
@petercorke
petercorke deleted the fix/int-image-clips-floats branch November 27, 2026 01:02
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant