Comments (7)
I guess we should add a Save as...
to the context menu?
from imageview.jl.
Just to check, do you know you can do this?
Cairo.write_to_png(imgc.c.back, "/tmp/annot.png")
That will write the Canvas exactly as it is (including the padding, if any, to set the aspect ratio) to a file.
from imageview.jl.
I added some functions to trim the padding: JuliaGraphics/Cairo.jl@98007fc and 35ce5b4. Pkg.update()
will get you both updates.
Still probably want to add it to the context menu, so I'll leave this open.
from imageview.jl.
Hi Tim,
Was out at a GRC. Did not know this-- thanks for the info and adding the write function.
from imageview.jl.
3+ years later, and I'm back 😄. This appears to work now:
function write_to_png(guidict, filename)
canvas = guidict["gui"]["canvas"]
ctx = getgc(canvas)
Cairo.write_to_png(ctx.surface, filename)
end
[edit] Spoke too soon. The getgc
sometimes fails with UndefRefError: access to undefined reference
. I don't quite understand that one, because I'm calling this after a guidict = imshow(img)
, and I see the image so the context should be there. I'm starting to get the feeling that I don't know what I'm doing here...
from imageview.jl.
Ok, after poking at this for a bit, I'm stumped. The call to getgc()
(or drilling into the context field directly) always fails from a test script with UndefRefError: access to undefined reference
, and always succeeds from the REPL.
The problem isn't because the window gets destroyed at the end of the script, because the error occurs before then. Adding the bit of code at the end of the README.md to wait on the window close event did not help either.
I've tried adding gc_preserve()
calls, but I'm not sure I hit the right incantation. I'm also not sure why they'd be necessary given this line in GtkReactive: https://github.com/JuliaGizmos/GtkReactive.jl/blob/8179c208ff5fa16d6d4879c8dce578cc68eff59b/src/graphics_interaction.jl#L244
Why is my graphic context vaporizing here? Pinging @timholy for desperately needed help!
from imageview.jl.
Hi @rsrock , I am wondering if it is possible to save gif/mp4 for movie-like images, i.e., images with the time axis.
from imageview.jl.
Related Issues (20)
- ImageView and PyPlot don't like each other HOT 1
- set aspect ratio
- ImageView sets environment variables that break other Gtk applications HOT 1
- StackOverflowError when using imshow HOT 2
- 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
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.