ImageSize constructor

ImageSize(width_pixels, height_pixels)

Initializes width and height to the given values in pixels. Initializes resolution to 96 dpi.

def __init__(self, width_pixels: int, height_pixels: int):
    ...
ParameterTypeDescription
width_pixelsintWidth in pixels.
height_pixelsintHeight in pixels.

ImageSize(width_pixels, height_pixels, horizontal_resolution, vertical_resolution)

Initializes width, height and resolution to the given values.

def __init__(self, width_pixels: int, height_pixels: int, horizontal_resolution: float, vertical_resolution: float):
    ...
ParameterTypeDescription
width_pixelsintWidth in pixels.
height_pixelsintHeight in pixels.
horizontal_resolutionfloatHorizontal resolution in DPI.
vertical_resolutionfloatVertical resolution in DPI.

See Also