Is it possible to generate a large sparse image in Julia?
The (excellent) library Images.jl
by Tim Holy looks like it is meant for full image matrices where one defines every pixel.
I would like to make a bifurcation diagram, which is rather sparse. Ideally I'd like to make one that is poster-size, but the corresponding full image matrix would be way too large to generate.
Thank you for your time.
An Image
can be created from any AbstractArray
, which includes a sparse matrix:
julia> using Images
julia> S = sprand(10^4, 10^4, 0.01);
julia> img = grayim(S)
Gray Images.Image with:
data: 10000x10000 Base.SparseMatrix.SparseMatrixCSC{Float64,Int64}
properties:
colorspace: Gray
spatialorder: x y
Now, what you do with this image will determine how happy you'll be with this. But nothing prevents you from defining it.
UPDATE: Images now treats any AbstractArray
as an image, there is no Images
type anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With