Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay has no show function #558

Closed
tlnagy opened this issue Sep 14, 2016 · 2 comments · Fixed by JuliaLang/IJulia.jl#463
Closed

Overlay has no show function #558

tlnagy opened this issue Sep 14, 2016 · 2 comments · Fixed by JuliaLang/IJulia.jl#463

Comments

@tlnagy
Copy link
Contributor

tlnagy commented Sep 14, 2016

It appears though that there isn't a dedicated show function for Overlay so it crashed my IJulia session (ref JuliaLang/IJulia.jl#455) due to the enormous amount of output.

Something like this with a 2000 by 2000 matrix instead of 10 by 10

julia> using Images

julia> using FixedPointNumbers

julia> using Colors

julia> im1 = convert(Image{Gray}, rand(0x00uf8:0xffuf8, 10, 10))
Gray Images.Image with:
  data: 10×10 Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2}
  properties:
    timedim: 0
    spatialorder:  y x
    pixelspacing:  1.0 1.0

julia> im2 = convert(Image{Gray}, rand(0x00uf8:0xffuf8, 10, 10))
Gray Images.Image with:
  data: 10×10 Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2}
  properties:
    timedim: 0
    spatialorder:  y x
    pixelspacing:  1.0 1.0

julia> Overlay((im1, im2), (RGB(1, 0, 0), RGB(0, 1, 0)))
10×10 Images.Overlay{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,2,Tuple{Images.Image{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2}},Images.Image{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2}}},Tuple{Images.ScaleMinMax{Float32,FixedPointNumbers.UFixed{UInt8,8},Float32},Images.ScaleMinMax{Float32,FixedPointNumbers.UFixed{UIn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0,0.0)
 RGB{U8}(0.0,0.0,0.0)  RGB{U8}(1.0,1.0,0.0)  RGB{U8}(1.0,1.0,0.0)  RGB{U8}(1.0,0.0,0.0)     RGB{U8}(1.0,1.0,0.0)  RGB{U8}(1.0,1.0,0.0)  RGB{U8}(1.0,0.0,0.0)  RGB{U8}(1.0,0.0,0.0)
 RGB{U8}(0.0,0.0,0.0)  RGB{U8}(0.0,1.0,0.0)  RGB{U8}(0.0,1.0,0.0)  RGB{U8}(0.0,1.0,0.0)     RGB{U8}(1.0,0.0,0.0)  RGB{U8}(1.0,1.0,0.0)  RGB{U8}(0.0,1.0,0.0)  RGB{U8}(0.0,0.0,0.0)
 RGB{U8}(1.0,0.0,0.0)  RGB{U8}(0.0,0.0,0.0)  RGB{U8}(0.0,0.0,0.0)  RGB{U8}(0.0,0.0,0.0)     RGB{U8}(0.0,1.0,0.0)  RGB{U8}(0.0,1.0,0.0)  RGB{U8}(1.0,0.0,0.0)  RGB{U8}(0.0,1.0,0.0)
 RGB{U8}(1.0,0.0,0.0)  RGB{U8}(1.0,1.0,0.0)  RGB{U8}(1.0,0.0,0.0)  RGB{U8}(0.0,1.0,0.0)     RGB{U8}(0.0,1.0,0.0)  RGB{U8}(1.0,0.0,0.0)  RGB{U8}(1.0,1.0,0.0)  RGB{U8}(1.0,0.0,0.0)

julia> im3 = Overlay((im1, im2), (RGB(1, 0, 0), RGB(0, 1, 0)))
10×10 Images.Overlay{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2,2,Tuple{Images.Image{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2}},Images.Image{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2,Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},2}}},Tuple{Images.ScaleMinMax{Float32,FixedPointNumbers.UFixed{UInt8,8},Float32},Images.ScaleMinMax{Float32,FixedPointNumbers.UFix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.0) RGB{U8}(1.0,1.0,0.0) RGB{U8}(1.0,1.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(1.0,0.0,0.0); RGB{U8}(0.0,0.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(1.0,1.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(0.0,0.0,0.0); RGB{U8}(1.0,0.0,0.0) RGB{U8}(0.0,0.0,0.0) RGB{U8}(0.0,0.0,0.0) RGB{U8}(0.0,0.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(0.0,0.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(0.0,1.0,0.0); RGB{U8}(1.0,0.0,0.0) RGB{U8}(1.0,1.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(0.0,0.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(0.0,1.0,0.0) RGB{U8}(1.0,0.0,0.0) RGB{U8}(1.0,1.0,0.0) RGB{U8}(1.0,0.0,0.0)]
@tlnagy
Copy link
Contributor Author

tlnagy commented Sep 14, 2016

This isn't a big deal if it weren't for JuliaLang/IJulia.jl#455 because it's currently pretty hard to recover a browser from it. Currently, I'm typing this in Chrome because Firefox is still trying to close that tab -____-

@tlnagy
Copy link
Contributor Author

tlnagy commented Sep 14, 2016

Ah, I now see the existence of OverlayImage. That solves this problem on the Images.jl side for now.

tlnagy added a commit to tlnagy/IJulia.jl that referenced this issue Sep 15, 2016
tlnagy added a commit to tlnagy/IJulia.jl that referenced this issue Sep 17, 2016
stevengj pushed a commit to JuliaLang/IJulia.jl that referenced this issue Sep 21, 2016
* truncate excess output per execution request

fixes JuliaImages/Images.jl#558, fixes #455

* apply to both stderr and stdout; rename accessor function
@tlnagy tlnagy closed this as completed Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant