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

Incorrectly export GIF image #368

Open
RexWzh opened this issue Dec 8, 2022 · 0 comments
Open

Incorrectly export GIF image #368

RexWzh opened this issue Dec 8, 2022 · 0 comments

Comments

@RexWzh
Copy link

RexWzh commented Dec 8, 2022

By save("xxx.gif", bitmat), one should get a white picture, however, the output is black.

using FileIO
save("one.gif", ones(Bool, 200, 200)) # get a black image
load("one.gif") |> iszero # true

small

More generally, when the rate of zeros is small enough, the ones-matrix is treated as a zeros-matrix.

a = ones(Bool, 200, 200)
# set zero on a small range
ind = rand(1:40000, 300)
a[ind] .= false
save("small.gif", a) 
load("small.gif") |> iszero # true again
# set zero on more place
ind = rand(1:40000, 3000)
a[ind] .= false
save("normal.gif", a) # now we get the right image

normal


This issue occurs only in the case of gif, might have to do with the wrapper of ImageMagick.jl?

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