API Documentation
Main module.
- class shrinkix.Shrinkix(*, keep_metadata=None, max_width=None, max_height=None, experimental_color_reduction=None, verbose=False, artist=None, copyright=None, background=None, quality=None)[source]
Bases:
object
- Parameters:
keep_metadata (bool | None)
max_width (int | None)
max_height (int | None)
experimental_color_reduction (bool | None)
verbose (bool)
artist (str | None)
copyright (str | None)
background (str | None)
quality (int | None)
- __init__(*, keep_metadata=None, max_width=None, max_height=None, experimental_color_reduction=None, verbose=False, artist=None, copyright=None, background=None, quality=None)[source]
Instantiate Shrinkix.
- Parameters:
keep_metadata (bool | None)
max_width (int | None)
max_height (int | None)
experimental_color_reduction (bool | None)
verbose (bool)
artist (str | None)
copyright (str | None)
background (str | None)
quality (int | None)
- Return type:
None
- shrink(image, output, format=None, colors=None)[source]
Shrink an image.
- Parameters:
image (str | Path | IO[bytes] | Image | SupportsArrayInterface)
output (str | Path | IO[bytes])
format (Literal['PNG', 'JPEG', 'JPG', 'WEBP'] | None)
colors (int | None)
- Return type:
None
- export_name(path, format)[source]
Export name.
- Parameters:
path (Path)
format (str | None)
- Return type:
str