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

failures when saving a matrix of bools or bitmatrix to png then reloading #233

Open
greghislop opened this issue Jun 26, 2024 · 0 comments

Comments

@greghislop
Copy link

When attempting to save a bitmatrix to a png using a random assignment of trues and falses and then loading the file back in again, I get the expected results of the two matrices being equal. When saving a matrix of all true values or almost all true values with just one or two set to false the result when reloading the file is a matrix of all zero values.

eg.
using ImageMagick
a=rand(Bool,500,500);
ImageMagick.save("test.png", a);

Produces a 1 bit grayscale png as expected, and

ImageMagick.load("test.png") == a

evaluates as true as expected. However

a=falses(500,500);
a[1,101]=true;
ImageMagick.load("test.png") == a

evaluates as false while the following is true

ImageMagick.load("test.png") == falses(500,500)

This was done on julia 1.8.5, but I understand it to also fail on much later versions. Any suggestions most welcome

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

No branches or pull requests

1 participant