Comments (7)
Closing the window is already possible already through the first output, but it's not as easy as it should be. The pull request referenced above would make it much easier.
What do you mean by "update"? The combination of the first and second outputs lets you call several of the functions in ImageView directly, notably resize
and redraw
. Need something different?
from imageview.jl.
Hey Tim, I'm trying to do the same thing here and don't think I understand the API fully.
I am writing an implementation of Seam Carving for Content-Aware Image Resizing (PDF), and so I want to do things like draw into the same window multiple times, preferably with the ability to output an image of different dimension each time. (Resizing the window frame itself would be nice as well). Can you post an example of the code needed to do that?
from imageview.jl.
Thanks for the explanation. Right now redrawing with an image of different dimensions is not supported. This is fixable, of course.
I'm on vacation right now and about to disappear for a multi-day backpacking trip, so now is not the time to push a possibly-breaking change. I'll try to get to this next week.
from imageview.jl.
@riegaz, @staticfloat this is done now. Sorry it took so darn long.
Here's a demo:
julia> using ImageView
julia> using TestImages
julia> lh = testimage("lighthouse.png")
RGB Image with:
data: 3x768x512 Uint8 Array
properties:
limits: (0x00,0xff)
colordim: 1
spatialorder: ["x","y"]
colorspace: RGB
julia> mand = testimage("mandrill.tiff")
RGB Image with:
data: 3x512x512 Uint8 Array
properties:
limits: (0x00,0xff)
colordim: 1
spatialorder: ["x","y"]
colorspace: RGB
julia> imgc, img2 = display(lh,pixelspacing=[1,1])
(ImageCanvas,ImageSlice2d: zoom = BoundingBox(0.0,768.0,0.0,512.0))
julia> display(imgc, mand)
(ImageCanvas,ImageSlice2d: zoom = BoundingBox(0.0,512.0,0.0,512.0))
Also, running "test/tile.jl" is fun.
from imageview.jl.
Awesome, thanks @timholy!
from imageview.jl.
I went back and re-read the issue, and noticed you folks asked a few more questions. So here are some other tidbits:
- If you want to "forget" the previous settings when you display a new image in an old ImageCanvas, just say
display(canvas(imgc), mand)
.canvas
returns aTk
Canvas
object. You can add settings after the image (mand
) if you want (e.g.,pixelspacing=[2,1]
). - If you want to close the window:
destroy(toplevel(imgc))
(toplevel
returns the window) - If you want to resize the window:
set_size(toplevel(imgc), w, h)
These features require master; I'll update the sha1 soon, but Ron Rock indicated he may also have some new stuff coming, so I'll wait a bit.
from imageview.jl.
I'm done now, but see the comment on the latest commit...
from imageview.jl.
Related Issues (20)
- Segmentation fault on using imshow HOT 1
- ImageView not precompiling on 1.9.0-alpha1
- Chrash when pointer moves over image HOT 10
- Windows becomes laggy when opening ImageView HOT 3
- ImageView's imshow incorrectly displays HSV images? HOT 1
- ImageView grinds Windows to a hold HOT 9
- Crash on second or third call to imshow() HOT 1
- Error calling imshow with no arguments
- Slow with large images HOT 5
- GLib-GObject-CRITICAL error using ImageView and Gtk4 on Linux HOT 2
- ImageView doesn't display data if plotting with PyPlot occurs first HOT 2
- imshow breaks with 4D images
- Inexact error when repeatedly calling imshow and scrolling HOT 1
- GTK related errors on HPC Cluster HOT 4
- Question: Visualizing high resolution image is slow HOT 2
- Minimizing window created with ImageView imshow crashes Julia HOT 2
- Error when trying to change frame of image stack HOT 1
- Display custom type with PNG support HOT 7
- Infinite loop when bars cross in contrast GUI
- Improper `Normed` handling in the contrast GUI HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imageview.jl.