Comments (4)
This is an area I need to document and improve. Scaling of images turns out to be surprisingly subtle. You generally want to take a Uint8
image at face value, but other types may need to be scaled for any kind of sensible display. The ScaleMinMax
type is a good general default; however, often one could get by with fewer operations, and at least when I tested it some time ago this can have a measurable impact on movie playing speeds. Hence the other types.
Are you calling this programmatically, or from ImageView
's display
? If programmatically, my recommendation is to create your own ScaleInfo
object. If you want to convert to a Uint8
you can say
uint32color!(buf, img, scaleminmax(img))
If you're calling it from display
, then I'm aware this is an area which needs some work. (I'm partway to having a GUI to show a histogram, but other priorities have risen above this one.) For now you should be able to say
display(img, render! = (buf, img) -> uint32color!(buf, img, scaleminmax(img))
If you have a movie, this will auto-scale each image separately. You can fix the range manually with scaleminmax(Uint8, img, minval, maxval)
instead of just scaleminmax(img)
.
Does this help?
from imageview.jl.
See also be64cbe8ba40fdf49374bbd854f223a4516f55c9.
from imageview.jl.
Also, I don't understand how you went from a Uint16
to a Uint64
.
from imageview.jl.
Now that's pretty nifty. I am using display()
for now, and your line up above scales my movie display range just right. I'm impressed that display()
makes it so easy to define custom renderers like that, I'm going to have to poke around in there some more.
Playback is at ~ 10 fps. I can't seem to get the right-click in the button area to change the frame rate on my Mac, but I don't really need that right now. Overall, pretty useful.
Your other question about Uint16
to Uint64
was actually answered by your changes to Images.jl in be64cbe. I was confused about the promotion to Uint64
with the bitwise &, but Stefan confirms that this is the expected behavior.
from imageview.jl.
Related Issues (20)
- 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
- Error when trying to change frame of image stack HOT 1
- Display custom type with PNG support HOT 7
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.