Skip to content

ImageView's imshow incorrectly displays HSV images? #283

Description

@mgr327

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:

rgb
hsv

# Activate a brand-new environment
import Pkg
Pkg.activate(temp=true)
Pkg.add(["Images", "ImageView"])
 
using Images
using ImageView

# Prepare one-pixel RGB image
x = zeros(RGB{N0f8}, (1,1))
x .= RGB(0, 1, 0) # green

imshow(x, name="RGB") # correctly displays green

# Convert to HSV
y = HSV.(x) # conversion seems to be correct,  HSV{Float32}(120.0f0,1.0f0,1.0f0)

imshow(y, name="HSV") # diplays red instead of green!

Information for the troubleshooting:

using(Dates)

today()
versioninfo()
Pkg.status()
julia> today()
2023-06-27

julia> versioninfo()
Julia Version 1.9.1
Commit 147bdf428cd (2023-06-07 08:27 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 4 on 8 virtual cores
Environment:
  LD_LIBRARY_PATH = :/home/xxxx/.emacs.d/tree-sitter-julia/src/
  JULIA_NUM_THREADS = 4
  LD_ARGV0_REL = ../bin/vshd
  JULIA_EDITOR = vim
  JULIA_PKG_DEVDIR = /home/xxxx/juliadev
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_PYTHONCALL_EXE = /home/xxxx/.julia/conda/3/bin/python

julia> Pkg.status()
Status `/tmp/jl_M9VHws/Project.toml`
  [86fae568] ImageView v0.11.6
  [916415d5] Images v0.25.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions