-
Notifications
You must be signed in to change notification settings - Fork 15
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
enable image display using ImageShow #41
base: master
Are you sure you want to change the base?
Conversation
I have no idea how this function could be coded as a test case... Perhaps just make sure this |
We could also add P.S. julia> using ImageCore
julia> img = rand(Gray{N0f8}, 4, 4)
4×4 Array{Gray{N0f8},2} with eltype Gray{Normed{UInt8,8}}:
Gray{N0f8}(0.133) Gray{N0f8}(0.949) Gray{N0f8}(0.992) Gray{N0f8}(0.286)
Gray{N0f8}(0.804) Gray{N0f8}(0.624) Gray{N0f8}(0.184) Gray{N0f8}(0.514)
Gray{N0f8}(0.063) Gray{N0f8}(0.541) Gray{N0f8}(0.337) Gray{N0f8}(0.02)
Gray{N0f8}(0.506) Gray{N0f8}(0.78) Gray{N0f8}(0.392) Gray{N0f8}(0.89)
julia> using ReferenceTests
julia> img
4×4 Array{Gray{N0f8},2} with eltype Gray{Normed{UInt8,8}}:
████████
████████
████████
████████ |
Here comes to a decision I'd like to hear your voice @oxinabox @Evizero There're two paths in front:
I prefer path two here since this package is designed for test stages, convenience could mean a lot; we won't like the way to manually add |
I would like to avoid (any more) adding dependencies with binary dependencies. |
With regard to the import time:
Just proposed to make FFTW a soft dependency of I feel like there's a need to sort out the dispatching rules for |
Both of these have been annoying to me lately. Because of binary issues. |
If JuliaImages/ImageCore.jl#106 got merged, then we don't require |
I'ld be down with it, if that was done |
With ImageCore v0.8.8 released, FFTW isn't required anymore, so I plan to just add ImageShow as a dependency to this package without Requires.jl Here's the speed up in ReferenceTests side (master branch):
Updating `~/Desktop/Project.toml`
[a09fc81d] ↓ ImageCore v0.8.10 ⇒ v0.8.7
Updating `~/Desktop/Manifest.toml`
[621f4979] + AbstractFFTs v0.5.0
[3da002f7] ↓ ColorTypes v0.9.0 ⇒ v0.8.1
[5ae59095] ↓ Colors v0.11.1 ⇒ v0.10.1
[7a1cc6ca] + FFTW v1.2.0
[f5851436] + FFTW_jll v3.3.9+3
[a09fc81d] ↓ ImageCore v0.8.10 ⇒ v0.8.7
[1d5cc7b8] + IntelOpenMP_jll v2018.0.3+0
[856f044c] + MKL_jll v2019.0.117+0 |
src/render.jl
Outdated
@@ -24,13 +24,27 @@ end | |||
|
|||
## 2 arg form render for comparing | |||
function render(mode::BeforeAfter, reference, actual) | |||
if showable(MIME("image/png"), actual) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if
statement is always true if ImageShow
is loaded, but what I actually want to check is if there's an available display for it.
Do you know how could I achieve it? @oxinabox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think displayable
instread of showable
5540741
to
0f2af14
Compare
println("- REFERENCE -------------------") | ||
render_item(mode, reference) | ||
println("-------------------------------") | ||
println("- ACTUAL ----------------------") | ||
render_item(mode, actual) | ||
println("-------------------------------") | ||
end | ||
function render(::MIME"image/png", mode::BeforeAfterImage, reference, actual) | ||
println("- REFERENCE --------|--------- ACTUAL -") | ||
display(MIME("image/png"), mosaicview(reference, actual; nrow=1, npad=5)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought MIME("image/png")
or "image/png"
would work, but this still renders images both in atom plot panel and in terminal 😕
@@ -19,6 +21,8 @@ Distances = "0.7, 0.8" | |||
FileIO = "1" | |||
ImageCore = "0.8.1" | |||
ImageInTerminal = "0.3, 0.4" | |||
ImageShow = "0.2" | |||
MosaicViews = "0.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MosaicView is planned to be reexported by ImageShow
It's not a trivial task to remove ImageTransformation from ImageInTerminal; for 24bit colors anti-alias restrict does improve the visual quality. So this is a future work -- after all, it's the status quo. I don't have any ideas to test this PR, any suggestions? |
Mocking.jl |
This patch only changes the render behavior for images when
ImageShow
is loaded in a MIME envionment(e.g, jupyter, juno, vscode):@juliohm I believe this is what you want in #26 ?
There're some binary dependencies that we don't like to have:
- [ ] SpecialFunctions: Don't depend on ImageTransformation JuliaImages/ImageInTerminal.jl#27