Skip to content

docs: Image() says that integer arrays are narrowed to the smallest type that holds them - #318

Merged
petercorke merged 2 commits into
mainfrom
docs/image-dtype-narrowing
Nov 26, 2026
Merged

petercorke merged 2 commits into
mainfrom
docs/image-dtype-narrowing

Conversation

@petercorke

Copy link
Copy Markdown
Owner

Image(array) stores an integer array in the smallest type that holds its values. A uint16 array whose values are all below 256 becomes uint8. That surprised us while writing tests, and the docstring did not mention it.

This adds a note to the Image() docstring with examples. They show the narrowing, dtype=True to keep the array's own type, and dtype="uint16" to force a type. Docs only, no code change.

An AI assistant (Claude Code) wrote this change.

🤖 Generated with Claude Code

…ype that holds them, and how to keep the dtype

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

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 51c7ee7 into main Nov 26, 2026
33 of 34 checks passed
@petercorke
petercorke deleted the docs/image-dtype-narrowing branch November 26, 2026 02:58
@github-actions github-actions Bot mentioned this pull request Nov 26, 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