Open mgr327 opened 1 year ago
I agree. This looks like a bug.
julia> using ImageView
julia> using ImageView, TestImages
julia> test = testimage("mandrill");
julia> imshow(HSV.(test))
Dict{String, Any} with 4 entries:
"gui" => Dict{String, Any}("window"=>GtkWindowLeaf(name="", parent, width-request=-1, height-request=-1, visi…
"roi" => Dict{String, Any}("redraw"=>ObserverFunction[ObserverFunction defined at C:\Users\kittisopikulm\.jul…
"annotations" => Observable(Dict{UInt64, Any}())
"clim" => nothing
We probably want something such as
julia> using Images, MappedArrays, TestImages
julia> import ImageView: imshow
julia> imshow(image::AbstractArray{<: Colorant}; kwargs...) = imshow(MappedArrays.mappedarray(RGB{N0f8}, image); kwargs...)
imshow (generic function with 23 methods)
julia> imshow(image::AbstractArray{RGB{N0f8}}; kwargs...) = invoke(imshow, Tuple{AbstractArray}, image; kwargs...)
imshow (generic function with 23 methods)
julia> test_hsv = HSV.(testimage("mandrill"));
julia> imshow(test_hsv)
Dict{String, Any} with 4 entries:
"gui" => Dict{String, Any}("window"=>GtkWindowLeaf(name="", parent, width-request=-1, height-request=-1, visi…
"roi" => Dict{String, Any}("redraw"=>ObserverFunction[ObserverFunction defined at C:\Users\kittisopikulm\.jul…
"annotations" => Observable(Dict{UInt64, Any}())
"clim" => Observable(CLim{RGB{Float64}}(RGB{Float64}(0.0,0.0,0.0), RGB{Float64}(1.0,1.0,1.0)))
For now, I suggest using MappedArrays
directly.
julia> using Images, MappedArrays, TestImages, ImageView
julia> test_hsv = HSV.(testimage("mandrill"));
julia> imshow(mappedarray(RGB{N0f8}, test_hsv))
Hello,
the toy code below demonstrates the problem: a one-pixel green RGB image is displayed as green, but is displayed as red when converted to HSV:
Information for the troubleshooting: