class_docstr: Constructs a ImageGPT image processor. This image processor can be used to resize images to a smaller resolution
  (such as 32x32 or 64x64), normalize them and finally color quantize them to obtain sequences of "pixel values"
  (color clusters).
  
  Args:
      clusters (`np.ndarray` or `List[List[int]]`, *optional*):
          The color clusters to use, of shape `(n_clusters, 3)` when color quantizing. Can be overriden by `clusters`
          in `preprocess`.
      do_resize (`bool`, *optional*, defaults to `True`):
          Whether to resize the image's dimensions to `(size["height"], size["width"])`. Can be overridden by
          `do_resize` in `preprocess`.
      size (`Dict[str, int]` *optional*, defaults to `{"height": 256, "width": 256}`):
          Size of the image after resizing. Can be overridden by `size` in `preprocess`.
      resample (`PILImageResampling`, *optional*, defaults to `Resampling.BILINEAR`):
          Resampling filter to use if resizing the image. Can be overridden by `resample` in `preprocess`.
      do_normalize (`bool`, *optional*, defaults to `True`):
          Whether to normalize the image pixel value to between [-1, 1]. Can be overridden by `do_normalize` in
          `preprocess`.
      do_color_quantize (`bool`, *optional*, defaults to `True`):
          Whether to color quantize the image. Can be overridden by `do_color_quantize` in `preprocess`.
class_docstr_tok: ["Constructs","a","ImageGPT","image","processor",".","This","image","processor","can","be","used","to","resize","images","to","a","smaller","resolution","(","such","as","32x32","or","64x64",")",",","normalize","them","and","finally","color","quantize","them","to","obtain","sequences","of","``","pixel","values","''","(","color","clusters",")",".","Args",":","clusters","(","`","np.ndarray","`","or","`","List","[","List","[","int","]","]","`",",","*","optional","*",")",":","The","color","clusters","to","use",",","of","shape","`","(","n_clusters",",","3",")","`","when","color","quantizing",".","Can","be","overriden","by","`","clusters","`","in","`","preprocess","`",".","do_resize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","resize","the","image","'s","dimensions","to","`","(","size","[","``","height","''","]",",","size","[","``","width","''","]",")","`",".","Can","be","overridden","by","`","do_resize","`","in","`","preprocess","`",".","size","(","`","Dict","[","str",",","int","]","`","*","optional","*",",","defaults","to","`","{","``","height","''",":","256",",","``","width","''",":","256","}","`",")",":","Size","of","the","image","after","resizing",".","Can","be","overridden","by","`","size","`","in","`","preprocess","`",".","resample","(","`","PILImageResampling","`",",","*","optional","*",",","defaults","to","`","Resampling.BILINEAR","`",")",":","Resampling","filter","to","use","if","resizing","the","image",".","Can","be","overridden","by","`","resample","`","in","`","preprocess","`",".","do_normalize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","normalize","the","image","pixel","value","to","between","[","-1",",","1","]",".","Can","be","overridden","by","`","do_normalize","`","in","`","preprocess","`",".","do_color_quantize","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","color","quantize","the","image",".","Can","be","overridden","by","`","do_color_quantize","`","in","`","preprocess","`","."]
code: def __init__(
      self,
      # clusters is a first argument to maintain backwards compatibility with the old ImageGPTImageProcessor
      clusters: Optional[Union[List[List[int]], np.ndarray]] = None,
      do_resize: bool = True,
      size: Dict[str, int] = None,
      resample: PILImageResampling = PILImageResampling.BILINEAR,
      do_normalize: bool = True,
      do_color_quantize: bool = True,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
      size = size if size is not None else {"height": 256, "width": 256}
      size = get_size_dict(size)
      self.clusters = (
          np.array(clusters) if clusters is not None else None
      )
      self.do_resize = do_resize
      self.size = size
      self.resample = resample
      self.do_normalize = do_normalize
      self.do_color_quantize = do_color_quantize
  
file_path: transformers/src/transformers/models/imagegpt/image_processing_imagegpt.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 rescale, resize, to_channel_dimension_format
  from ...image_utils import ChannelDimension, ImageInput, PILImageResampling, infer_channel_dimension_format, is_scaled_image, make_list_of_images, to_numpy_array, valid_images
  from ...utils import TensorType, is_vision_available, logging
label_desc: Use image node_id 1 to create a new ImageGPTImageProcessor object from inherited base classes: BaseImageProcessor with example: obj = ImageGPTImageProcessor(clusters, do_resize, size, resample, do_normalize, do_color_quantize)