Skip to content

synchronize default scaling among ImageShow, ImageView, and Plots? #7

@JeffBezanson

Description

@JeffBezanson

Given color components outside [0,1], currently we have the following:

  • ImageShow/IJulia: clamp
  • ImageView: uses minimum and maximum value as black and white
  • Plots: errors

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:

  • Let lo, hi = extrema(image)
  • Black = 0 <= lo <= 1 ? 0 : lo
  • White = 0 <= hi <= 1 ? 1 : hi

The intuition is as follows:

  • If all values are between 0 and 1, just use them directly as intensities.
  • If the values are all over the place, use the min and max as black and white (what ImageView does now).
  • If values are generally in [0,1] but some go outside the range in one direction, rescale around 0 or 1 to bring those values back into range.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions