Imageedit Index / Imageedit / Io
Auto-generated documentation for imageedit.io module.
-
FILE_EXTS
- fmt: off: ['bmp', 'dib', 'eps', 'gif', 'ico', 'im', 'jpeg', 'jpg', 'j2k', 'j2p', 'j2xjfif', 'msp', 'pcx', 'png', 'pbm', 'pgm', 'ppm', 'pnm', 'sgi', 'spi', 'tga', 'tiff', 'webp', 'xbm', 'blp', 'cur', 'dcx', 'dds', 'fli', 'flc', 'fpx', 'ftex', 'gbr', 'gd', 'imt', 'pcd', 'xpm']
Throw an error and abort if the path does not exist.
def checkExists(file): ...
Combine two images with alpha.
def combine(
foregroundImage,
backgroundImage,
foregroundOffsets=(0, 0),
backgroundOffsets=(0, 0),
foregroundAlpha=1.0,
backgroundAlpha=1.0,
): ...
Get the contrast ratio of an image
def getContrastRatio(image: Image.Image) -> float: ...
Get an image description returns [icon/mask]. Likely more useful for my specific use case than in the general lib.
image
PIL.Image.Image - Image
str
- description of image
def getImageDesc(image: Image.Image) -> str: ...
Get the pixel dimensions for an image from one of the following.
pixel (no calculation): int, percent: "val%", scale: "valx"
image
Image.Image - Input imagedimens
int|str - One of pixel, percent, scale
list[int]
- outDimens in pixels
def getPixelDimens(image: Image.Image, dimens: list[int | str]) -> list[int]: ...
Get the list of colours in an image sorted by 'popularity'.
image
PIL.Image.Image - Image to get colours from
(colour_count,
colour)[] - list of tuples in the form pixel_count, colour
def getSortedColours(
image: Image.Image,
) -> list[tuple[int, tuple[int, int, int, int]]]: ...
Open a single image and returns an image object.
Use full file path or file path relative to /lib
file
str - full file path or file path relative to /libmode
str,None - open image with a mode (optional)
Image.Image
- Image
def openImage(file: str, mode: str | None = None) -> Image.Image: ...
Open all images in a directory and returns them in a list along with filepath.
dirGlob
str - in the form "input/*."mode
str,None - open image with a mode (optional)
PIL.Image.Image
- Image
def openImagesInDir(
dirGlob: str, mode: str | None = None
) -> list[tuple[str, Image.Image]]: ...
Reduces the number of colours in an image. Modes "logo", "optimised".
image
PIL.Image.Image - Input imagemode
str, optional - Mode "logo" or "optimised". Defaults to "optimised".
PIL.Image.Image
- A PIL Image
def reduceColours(image: Image.Image, mode: str = "optimised"): ...
Save a single image.
Use full file path or file path relative to /lib. Pass in the image object
fileName
string - full file path or file path relative to /libimage
PIL.Image.Image - A PIL Image
def saveImage(fileName, image): ...