docstr: Standardized ndimage metadata
  Parameters
  ----------
  index : int
      If the ImageResource contains multiple ndimages, and index is an
      integer, select the index-th ndimage from among them and return its
      properties. If index is an ellipsis (...), read and return the
      properties of all ndimages in the file stacked along a new batch
      dimension. If index is None, this plugin reads and returns the
      properties of the first image (index=0) unless the image is a GIF or
      APNG, in which case it reads and returns the properties all images
      (index=...).
  
  Returns
  -------
  properties : ImageProperties
      A dataclass filled with standardized image metadata.
  
  Notes
  -----
  This does not decode pixel data and is fast for large images.
docstr_tok: ["Standardized","ndimage","metadata","Parameters","--","--","--","--","--","index",":","int","If","the","ImageResource","contains","multiple","ndimages",",","and","index","is","an","integer",",","select","the","index-th","ndimage","from","among","them","and","return","its","properties",".","If","index","is","an","ellipsis","(","...",")",",","read","and","return","the","properties","of","all","ndimages","in","the","file","stacked","along","a","new","batch","dimension",".","If","index","is","None",",","this","plugin","reads","and","returns","the","properties","of","the","first","image","(","index=0",")","unless","the","image","is","a","GIF","or","APNG",",","in","which","case","it","reads","and","returns","the","properties","all","images","(","index=","...",")",".","Returns","--","--","--","-","properties",":","ImageProperties","A","dataclass","filled","with","standardized","image","metadata",".","Notes","--","--","-","This","does","not","decode","pixel","data","and","is","fast","for","large","images","."]
code: def properties(self, index: int = None) -> ImageProperties:
      """Standardized ndimage metadata
      Parameters
      ----------
      index : int
          If the ImageResource contains multiple ndimages, and index is an
          integer, select the index-th ndimage from among them and return its
          properties. If index is an ellipsis (...), read and return the
          properties of all ndimages in the file stacked along a new batch
          dimension. If index is None, this plugin reads and returns the
          properties of the first image (index=0) unless the image is a GIF or
          APNG, in which case it reads and returns the properties all images
          (index=...).
  
      Returns
      -------
      properties : ImageProperties
          A dataclass filled with standardized image metadata.
  
      Notes
      -----
      This does not decode pixel data and is fast for large images.
  
      """
  
      if index is None:
          if self._image.format == "GIF":
              index = Ellipsis
          elif self._image.custom_mimetype == "image/apng":
              index = Ellipsis
          else:
              index = 0
  
      if index is Ellipsis:
          self._image.seek(0)
      else:
          self._image.seek(index)
  
      if self._image.mode == "P":
          # mode of palette images is determined by their palette
          mode = self._image.palette.mode
      else:
          mode = self._image.mode
  
      width: int = self._image.width
      height: int = self._image.height
      shape: Tuple[int, ...] = (height, width)
  
      n_frames: Optional[int] = None
      if index is ...:
          n_frames = getattr(self._image, "n_frames", 1)
          shape = (n_frames, *shape)
  
      dummy = np.asarray(Image.new(mode, (1, 1)))
      pil_shape: Tuple[int, ...] = dummy.shape
      if len(pil_shape) > 2:
          shape = (*shape, *pil_shape[2:])
  
      return ImageProperties(
          shape=shape,
          dtype=dummy.dtype,
          n_images=n_frames,
          is_batch=index is Ellipsis,
      )
  
imports: import sys
  import warnings
  from io import BytesIO
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, cast
  import numpy
  from PIL import ExifTags, GifImagePlugin, Image, ImageSequence, UnidentifiedImageError
  from PIL import __version__
  from ..core.request import URI_BYTES, InitializationError, IOMode, Request
  from ..core.v3_plugin_api import ImageProperties, PluginV3
  from ..typing import ArrayLike
label_desc: Use image node_id 10 for calling the PillowPlugin obj's underlying member method code with example usage: obj.properties(index) and returns: ImageProperties