Incorrectly export GIF image
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 228
- Forks
- 81
- Avg merge
- 1d 29m
- Merged PRs (30d)
- 1
Description
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

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

This issue occurs only in the case of gif, might have to do with the wrapper of ImageMagick.jl?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the Julia FileIO.save and load examples for all-ones and mostly-ones Bool matrices. Start by tracing GIF handling through FileIO and the suspected ImageMagick.jl wrapper; done means saving and loading these matrices no longer turns a mostly-one image into an all-zero image.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100