API Documentation

Main module.

shrinkix.entrypoint(argv=None)[source]

Entrypoint for command line interface.

Parameters:

argv (Sequence[str] | None) –

Return type:

None

class shrinkix.Shrinkix(*, format=None, keep_metadata=None, max_width=None, max_height=None, fast_color_reduction=None, verbose=False, artist=None, copyright=None)[source]

Bases: object

Parameters:
  • format (Literal['PNG', 'JPG'] | None) –

  • keep_metadata (bool | None) –

  • max_width (int | None) –

  • max_height (int | None) –

  • fast_color_reduction (bool | None) –

  • verbose (bool) –

  • artist (str | None) –

  • copyright (str | None) –

__init__(*, format=None, keep_metadata=None, max_width=None, max_height=None, fast_color_reduction=None, verbose=False, artist=None, copyright=None)[source]

Instantiate Shrinkix.

Parameters:
  • format (Literal['PNG', 'JPG'] | None) –

  • keep_metadata (bool | None) –

  • max_width (int | None) –

  • max_height (int | None) –

  • fast_color_reduction (bool | None) –

  • verbose (bool) –

  • artist (str | None) –

  • copyright (str | None) –

Return type:

None

shrink(image, output)[source]

Shrink an image.

Parameters:
  • image (str | Path | IO[bytes] | Image | ndarray[Any, dtype[Any]]) –

  • output (str | Path | IO[bytes]) –

Return type:

None

export_name(path)[source]

Export name.

Parameters:

path (Path) –

Return type:

str

bulk(files, output)[source]

Shrink a list of file and export it in output.

Parameters:
  • files (List[str | Path]) –

  • output (str | Path) –

Return type:

None

reduce(image)[source]

Reduce image colors.

Parameters:

image (str | Path | IO[bytes] | Image | ndarray[Any, dtype[Any]]) –

Return type:

Image