Skip to content

Add support for flat uint8 arrow arrays for multi channel images #8908

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

wiredfool
Copy link
Member

Fixes #8907 .

Changes proposed in this pull request:

  • Support for flattened arrays of the form [r,g,b,a,r,g,b,a....] in Image.fromarrow
  • Tested support for uint32 whole pixels into the multichannel images in Image.fromarrow

@wiredfool wiredfool changed the title Add support for flat uint8 arrays for multi channel images Add support for flat uint8 arrow arrays for multi channel images Apr 21, 2025
wiredfool and others added 4 commits May 23, 2025 10:58
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
if (strcmp(schema->format, "C") == 0 // uint8
&& im->pixelsize == 4 // storage as 32 bpc
&& schema->n_children == 0 // make sure schema is well formed.
&& strcmp(im->arrow_band_format, "C") == 0 // Expected Format
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
&& strcmp(im->arrow_band_format, "C") == 0 // Expected Format
&& strcmp(im->arrow_band_format, "C") == 0 // expected format

px = img.load()
assert px is not None
if mask is None:
# have to do element wise comparison when we're comparing
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# have to do element wise comparison when we're comparing
# have to do element-wise comparison when we're comparing

px = img.load()
assert px is not None
if elts_per_pixel > 1 and mask is None:
# have to do element wise comparison when we're comparing
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# have to do element wise comparison when we're comparing
# have to do element-wise comparison when we're comparing

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.

Image.fromarrow minimal example does not work
2 participants