class_docstr: Interface for 2 or 3D arrays representing images
  of raw luminance values, RGB values or HSV values.
class_docstr_tok: ["Interface","for","2","or","3D","arrays","representing","images","of","raw","luminance","values",",","RGB","values","or","HSV","values","."]
code: def range(cls, obj, dim):
      dim = obj.get_dimension(dim, strict=True)
      dim_idx = obj.get_dimension_index(dim)
      if dim_idx in [0, 1] and obj.bounds:
          l, b, r, t = obj.bounds.lbrt()
          if dim_idx:
              (low, high) = (b, t)
              density = obj.ydensity
          else:
              low, high = (l, r)
              density = obj.xdensity
          halfd = (1.0 / density) / 2.0
          if isinstance(low, util.datetime_types):
              halfd = np.timedelta64(int(round(halfd)), obj._time_unit)
          drange = (low + halfd, high - halfd)
      elif 1 < dim_idx < len(obj.vdims) + 2:
          dim_idx -= 2
          data = np.atleast_3d(obj.data)[:, :, dim_idx]
          if dim.nodata is not None:
              data = cls.replace_value(data, dim.nodata)
          drange = finite_range(data, np.nanmin(data), np.nanmax(data))
      else:
          drange = (None, None)
      return drange
  
imports: import numpy
  from ..None import util
  from ..boundingregion import BoundingBox
  from ..dimension import dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check
  from ..sheetcoords import SheetCoordinateSystem, Slice
  from .grid import GridInterface
  from .interface import DataError, Interface
  from .util import finite_range
label_desc: Use image node_id 10 for calling the ImageInterface obj's underlying member method code with example usage: obj.range(cls, obj, dim) and returns: drange