class_docstr: Image conversion settings.
class_docstr_tok: ["Image","conversion","settings","."]
docstr: Initialize settings object.
  
  Args:
    img_format: image output format, e.g., 'png', 'jpeg', etc. See supported
                PIL image types.
    width: desired output width in pixels.
    height: desired output height in pixels.
    position: position of resized image within new size frame. This should
              be specified as a tuple with each value between [0, 1].
              Default is (0.5, 0.5) for center.
    bg_color_rgb: Background color in RGB values. E.g., (255, 255, 255).
    opacity: Opacity or alpha value, from 0 to 255.
    resize_if_larger: If True, will resize the image to fit the larger size
                      if the desired output size is larger than the original
                      image size.
    preserve_aspect_ratio: If True, will attempt to preserve the original
                           image's aspect ration when resizing. Otherwise
                           will attempt a best effort. See PIL ImageOps.fit
                           documentation.
docstr_tok: ["Initialize","settings","object",".","Args",":","img_format",":","image","output","format",",","e.g.",",","'png","'",",","'jpeg","'",",","etc",".","See","supported","PIL","image","types",".","width",":","desired","output","width","in","pixels",".","height",":","desired","output","height","in","pixels",".","position",":","position","of","resized","image","within","new","size","frame",".","This","should","be","specified","as","a","tuple","with","each","value","between","[","0",",","1","]",".","Default","is","(","0.5",",","0.5",")","for","center",".","bg_color_rgb",":","Background","color","in","RGB","values",".","E.g.",",","(","255",",","255",",","255",")",".","opacity",":","Opacity","or","alpha","value",",","from","0","to","255.","resize_if_larger",":","If","True",",","will","resize","the","image","to","fit","the","larger","size","if","the","desired","output","size","is","larger","than","the","original","image","size",".","preserve_aspect_ratio",":","If","True",",","will","attempt","to","preserve","the","original","image","'s","aspect","ration","when","resizing",".","Otherwise","will","attempt","a","best","effort",".","See","PIL","ImageOps.fit","documentation","."]
code: def __init__(
      self,
      img_format,
      width,
      height,
      position=(0.5, 0.5),
      bg_color_rgb=(0, 0, 0),
      opacity=DEFAULT_OPACITY,
      resize_if_larger=False,
      preserve_aspect_ratio=True,
  ):
      """Initialize settings object.
  
      Args:
        img_format: image output format, e.g., 'png', 'jpeg', etc. See supported
                    PIL image types.
        width: desired output width in pixels.
        height: desired output height in pixels.
        position: position of resized image within new size frame. This should
                  be specified as a tuple with each value between [0, 1].
                  Default is (0.5, 0.5) for center.
        bg_color_rgb: Background color in RGB values. E.g., (255, 255, 255).
        opacity: Opacity or alpha value, from 0 to 255.
        resize_if_larger: If True, will resize the image to fit the larger size
                          if the desired output size is larger than the original
                          image size.
        preserve_aspect_ratio: If True, will attempt to preserve the original
                               image's aspect ration when resizing. Otherwise
                               will attempt a best effort. See PIL ImageOps.fit
                               documentation.
      """
      self._format = img_format
      self._width = width
      self._height = height
      self._transparency = opacity
      self._opacity = opacity
      # Background color is specified as RGBA
      self._bg_mode = "RGBA"
      self._bg_color = (
          bg_color_rgb[0],
          bg_color_rgb[1],
          bg_color_rgb[2],
          opacity,
      )
      self._position = position
      self._preserve_aspect_ratio = preserve_aspect_ratio
      # Whether image should be upsized if desired size is larger than orig size.
      self._resize_if_larger = resize_if_larger
  
      self._validate_settings()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl import logging
  from PIL import Image
  from PIL import ImageOps
label_desc: Use image node_id 1 to create a new ImageConvertSettings object from inherited base classes: object with example: obj = ImageConvertSettings(img_format, width, height, position, bg_color_rgb, opacity, resize_if_larger, preserve_aspect_ratio)