PyDL:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- pydl v0.7.0 »
- SDSS Utilities (`pydl.pydlutils`) »
- nw_cut_to_box

# nw_cut_to_box

`pydl.pydlutils.rgbcolor.``nw_cut_to_box`(colors, origin=(0.0, 0.0, 0.0))

  Limits the pixel values of the image to a ‘box’, so that the colors do not saturate to white but to a specific color.

  Parameters:

  colors : `ndarray`

  > 3D Array containing RGB image. The dimensions should be (X, Y, 3).

  origin : `tuple()` or `ndarray`

  > An array with 3 elements. The “distance” from this origin is considered saturated.

  Returns:

  `ndarray`

  > The “boxed” image.

  Raises:

  :exc:`ValueError`

  > If `colors` or `origin` has the wrong shape.