class_docstr: Constructs a Donut image processor.
  
  Args:
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the image's (height, width) dimensions to the specified `size`. Can be overridden by
          `do_resize` in the `preprocess` method.
      size (`Dict[str, int]` *optional*, defaults to `{"shortest_edge": 224}`):
          Size of the image after resizing. The shortest edge of the image is resized to size["shortest_edge"], with
          the longest edge resized to keep the input aspect ratio. Can be overridden by `size` in the `preprocess`
          method.
      resample (`PILImageResampling`, *optional*, defaults to `Resampling.BILINEAR`):
          Resampling filter to use if resizing the image. Can be overridden by `resample` in the `preprocess` method.
      do_thumbnail (`bool`, *optional*, defaults to `True`):
          Whether to resize the image using thumbnail method.
      do_align_long_axis (`bool`, *optional*, defaults to `False`):
          Whether to align the long axis of the image with the long axis of `size` by rotating by 90 degrees.
      do_pad (`bool`, *optional*, defaults to `True`):
          Whether to pad the image. If `random_padding` is set to `True` in `preprocess`, each image is padded with a
          random amont of padding on each size, up to the largest image size in the batch. Otherwise, all images are
          padded to the largest image size in the batch.
      do_rescale (`bool`, *optional*, defaults to `True`):
          Whether to rescale the image by the specified scale `rescale_factor`. Can be overridden by `do_rescale` in
          the `preprocess` method.
      rescale_factor (`int` or `float`, *optional*, defaults to `1/255`):
          Scale factor to use if rescaling the image. Can be overridden by `rescale_factor` in the `preprocess`
          method.
      do_normalize (`bool`, *optional*, defaults to `True`):
          Whether to normalize the image. Can be overridden by `do_normalize` in the `preprocess` method.
      image_mean (`float` or `List[float]`, *optional*, defaults to `IMAGENET_STANDARD_MEAN`):
          Mean to use if normalizing the image. This is a float or list of floats the length of the number of
          channels in the image. Can be overridden by the `image_mean` parameter in the `preprocess` method.
      image_std (`float` or `List[float]`, *optional*, defaults to `IMAGENET_STANDARD_STD`):
          Image standard deviation.
code: def __init__(
      self,
      do_resize: bool = True,
      size: Dict[str, int] = None,
      resample: PILImageResampling = PILImageResampling.BILINEAR,
      do_thumbnail: bool = True,
      do_align_long_axis: bool = False,
      do_pad: bool = True,
      do_rescale: bool = True,
      rescale_factor: Union[int, float] = 1 / 255,
      do_normalize: bool = True,
      image_mean: Optional[Union[float, List[float]]] = None,
      image_std: Optional[Union[float, List[float]]] = None,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
  
      size = (
          size if size is not None else {"height": 2560, "width": 1920}
      )
      if isinstance(size, (tuple, list)):
          # The previous feature extractor size parameter was in (width, height) format
          size = size[::-1]
      size = get_size_dict(size)
  
      self.do_resize = do_resize
      self.size = size
      self.resample = resample
      self.do_thumbnail = do_thumbnail
      self.do_align_long_axis = do_align_long_axis
      self.do_pad = do_pad
      self.do_rescale = do_rescale
      self.rescale_factor = rescale_factor
      self.do_normalize = do_normalize
      self.image_mean = (
          image_mean
          if image_mean is not None
          else IMAGENET_STANDARD_MEAN
      )
      self.image_std = (
          image_std if image_std is not None else IMAGENET_STANDARD_STD
      )
  
file_path: transformers/src/transformers/models/donut/image_processing_donut.py
imports: from typing import Dict, List, Optional, Union
  import numpy
  from ...image_processing_utils import BaseImageProcessor, BatchFeature, get_size_dict
  from ...image_transforms import get_resize_output_image_size, pad, resize, to_channel_dimension_format
  from ...image_utils import IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD, ChannelDimension, ImageInput, PILImageResampling, get_image_size, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import TensorType, logging
  from ...utils.import_utils import is_vision_available
label_desc: Use image node_id 1 to create a new DonutImageProcessor object from inherited base classes: BaseImageProcessor with example: obj = DonutImageProcessor(do_resize, size, resample, do_thumbnail, do_align_long_axis, do_pad, do_rescale, rescale_factor, do_normalize, image_mean, image_std)