This is a trivial question, of course, but I'm having a hard time finding a working answer.
Given a matrix A ( either 2d for grayscale, or 3d for RGB) how to save it on the disk as an image file using Julia?
I have an old code written in 2016 when I would use
save("filename.png",Images.colorim(matrix_A))
Now this seems to be gone for good.
you could use colorview
to view your raw matrix as an image and then save it.
julia> using Images
julia> save("gray.png", colorview(Gray, rand(256,256)))
julia> save("rgb.png", colorview(RGB, rand(3,256,256)))
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