JuliaImages / ImageInTerminal.jl

Julia package for displaying images in the terminal using ANSI colors and Unicode characters
Other
113 stars 13 forks source link

Add play and explore for 3D and framestack image playback/interaction #43

Closed IanButterworth closed 2 years ago

IanButterworth commented 3 years ago

I thought these methods would make more sense in here than in https://github.com/IanButterworth/VideoInTerminal.jl given they require no further deps, and feel like an extension of current ImageInTerminal offerings.

using ImageInTerminal, TestImages
img3D = testimage("mri-stack")
explore(img3D, 3) # explore along dimension 3
play(img3D, 3) # play along dimension 3 (like explore but start playing, and exit when done)
explore_mri
using ImageInTerminal, ImageCore
framestack = map(_->rand(Gray{N0f8}, 100, 100), 1:200)
play(framestack, fps = 24) # play framestack back at a target of 24 fps
explore(framestack, fps = 24) # like play, but start paused

The methods that depend on VideoIO could stay in VideoInTerminal (like the webcam viewer.. which I recommend trying out!)

pkg> add https://github.com/IanButterworth/VideoInTerminal.jl 
julia> using VideoInTerminal
julia> showcam()

It's so awesome how well this works ImageInTerminal. The frame rates are really impressive. Nice work!

johnnychen94 commented 3 years ago

Thanks for proposing the new functionalities. I just come back from vacation; will try this out and fix the test tomorrow night.

IanButterworth commented 3 years ago

@johnnychen94 just checking in on this. I believe your plan was to extend it to ImageShow first?

johnnychen94 commented 3 years ago

Yes, I feel it a little bit hard to maintain by mixing both terminal display and keyboard IO control. So I want to put the keyboard IO control part to ImageShow, and then extend the terminal display feature here. That said, ImageInTerminal will depend on ImageShow in the future.

I'm recently started to finish my pending PRs, and this is on my to-do list.

So I want to put the keyboard IO control part to ImageShow

Ideally, we need an independent package (maybe KeyboardEvents.jl) for this, but I'm a little bit reluctant to have more packages given my limited time here...

t-bltg commented 2 years ago

Superseded by https://github.com/JuliaImages/ImageShow.jl/pull/29.