Skip to content
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

imread returns different shape on different computers for the same image #6523

Open
xactbupt opened this issue Sep 16, 2022 · 2 comments
Open
Labels
🫂 Support User help and QA 😴 Dormant no recent activity

Comments

@xactbupt
Copy link

xactbupt commented Sep 16, 2022

Description

read an indexed image with io.imread on two computers with same skimage version using the same code, one computer return (512,152,4), the other one returns (512,512,3)

Way to reproduce

from skimage import io
import matplotlib.pylab as plt
from matplotlib.colors import ListedColormap
import numpy as np

img_index = io.imread('images/lenna_index.bmp')
img_index.shape
# upload all necessary images to github too!

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print(f'scikit-image version: {skimage.__version__}')
import numpy; print(f'numpy version: {numpy.__version__}')
Python 3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:33) 
[Clang 13.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from __future__ import print_function
>>> import sys; print(sys.version)
3.9.13 | packaged by conda-forge | (main, May 27 2022, 17:00:33) 
[Clang 13.0.1 ]
>>> import platform; print(platform.platform())
macOS-12.6-arm64-arm-64bit
>>> import skimage; print(f'scikit-image version: {skimage.__version__}')
scikit-image version: 0.19.2
>>> import numpy; print(f'numpy version: {numpy.__version__}')
numpy version: 1.22.3

2022-09-16 23 04 53

WechatIMG127

lenna_index.bmp.zip

@grlee77
Copy link
Contributor

grlee77 commented Sep 16, 2022

Hi @xactbupt, the image I/O operations will get sent to an underlying package such as imageio, tifffile or pillow so it is likely the difference in one of these that is the cause of the difference here. You may want to compare the versions of imageio for example as this may explain the difference (not 100% sure off-hand which backend is the default for BMP files).

On an unrelated note, you may want to reconsider use of the Lena image per her wishes. It was removed from skimage.data several years ago (replaced by skimage.data.astronaut()). An article with some additional context

@github-actions
Copy link

Hey, there hasn't been any activity on this issue for more than 180 days. For now, we have marked it as "dormant" until there is some new activity. You are welcome to reach out to people by mentioning them here or on our forum if you need more feedback! If you think that this issue is no longer relevant, you may close it by yourself; otherwise, we may do it at some point (either way, it will be done manually). In any case, thank you for your contributions so far!

@github-actions github-actions bot added the 😴 Dormant no recent activity label Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🫂 Support User help and QA 😴 Dormant no recent activity
Projects
None yet
Development

No branches or pull requests

3 participants