-
Notifications
You must be signed in to change notification settings - Fork 9
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
synchronize default scaling among ImageShow, ImageView, and Plots? #7
Comments
Why not just have |
Often a processed image has values in a different range, e.g. after convolution with certain kernels, or because it came from some data source with a strange representation. Now of course, in those cases you might eventually apply some custom scaling to get a real usable image out, but for development it's nice to be able to quickly look at the data with some reasonable default scaling. I suppose if the |
I agree completely on the consistency. But not sure I understand what you mean by telling Plots you want the data treated like an image. Isn't that what using Plots
a = 0.6rand(200,200).+0.2
plot(
plot(Gray.(a)),
heatmap(a, c = :grays),
heatmap(a, c = :grays, clim = (0,1), legend = false),
layout = (1,3), size = (800, 250)
) IIUC |
Ok, I agree. We should consistently render |
Great, I'll implement the clamp. |
Given color components outside [0,1], currently we have the following:
It would be nice to handle this consistently. I prefer the ImageView.jl behavior, since it generally lets you see as much data as possible. However, I will also suggest the following algorithm:
lo, hi = extrema(image)
0 <= lo <= 1 ? 0 : lo
0 <= hi <= 1 ? 1 : hi
The intuition is as follows:
The advantage of this is that when some values overflow or underflow a bit, 0.5 still looks "grayish" just like it would if you clamped the values, but without losing information.
The text was updated successfully, but these errors were encountered: