-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
8bit grayscale now loaded as RGB #1032
Comments
Interesting find, thanks for the report @petsuter . I'll try to have a look tomorrow and see if I can find the reason for the behavior change. In the meantime, you can "force" a grayscale result by using: >>> import imageio.v3 as iio
>>> iio.imread("https://github.com/sondrele/rust-bmp/raw/master/test/bmpsuite-2.5/g/pal8gs.bmp", mode="L").shape
(64, 127) |
Thanks, that's very helpful to know. 👍 Is that documented somewhere? Is it specific to Pillow? As far as I can tell:
(Where So maybe this changed because the legacy Pillow plugin is not used anymore, maybe since #824 (mentioned as the change of v2.28.0)? |
I'd also like to read 16 bit grayscale images in the same code. Example: https://github.com/lunapaint/pngsuite/blob/main/png/basi0g16.png >>> imageio.v3.imread("basi0g16.png").dtype
dtype('int32')
>>> imageio.v3.imread("basi0g16.png", mode="L").dtype
dtype('uint8')
>>> imageio.v3.imread("basi0g16.png", mode="I").dtype
dtype('int32')
>>> imageio.v3.imread("basi0g16.png", mode="I;16").dtype
dtype('uint16')
>>> imageio.v3.improps("basi0g16.png")
ImageProperties(shape=(32, 32), dtype=dtype('int32'), n_images=None, is_batch=False, spacing=None)
>>> imageio.v3.immeta("basi0g16.png")
{'interlace': 1, 'gamma': 1.0, 'mode': 'I', 'shape': (32, 32)} So using |
Is |
You may change the plugin to read the image:
|
Hi,
Example file: https://github.com/sondrele/rust-bmp/raw/master/test/bmpsuite-2.5/g/pal8gs.bmp
Such grayscale images are now loaded as RGB:
They used to be loaded as grayscale:
Is this a bug / intended? Can it be disabled / controlled somehow?
Thanks.
The text was updated successfully, but these errors were encountered: