JuliaImages / ImageView.jl

Interactive display of images and movies
MIT License
136 stars 32 forks source link

How to change contrast in imshow (without right clicking)? #239

Closed afkowalski closed 3 years ago

afkowalski commented 3 years ago

Hi,

Is there a way to change the contrast (clim min and max values) via command line easily? I looked at the source code and am not able to figure it out.

Thanks, Adam

timholy commented 3 years ago
julia> img = testimage("cam");
[ Info: Precompiling ImageMagick [6218d12a-5da1-5696-b52f-db25d2ecc6d1]

julia> gd = imshow(img)
Dict{String, Any} with 4 entries:
  "gui"         => Dict{String, Any}("window"=>GtkWindowLeaf(name="", parent, w…
  "roi"         => Dict{String, Any}("redraw"=>37: "map(clim-mapped image, inpu…
  "annotations" => 3: "input-2" = Dict{UInt64, Any}() Dict{UInt64, Any} 
  "clim"        => 2: "CLim" = CLim{N0f8}(0.0, 1.0) CLim{N0f8} 

julia> gd["clim"]
2: "CLim" = CLim{FixedPointNumbers.N0f8}(0.0N0f8, 1.0N0f8) CLim{FixedPointNumbers.N0f8} 

julia> push!(gd["clim"], CLim(0.2, 0.4))
afkowalski commented 3 years ago

Thanks a lot Tim!