vllm.multimodal.image ¶
ImageEmbeddingMediaIO ¶
Source code in vllm/multimodal/image.py
ImageMediaIO ¶
Source code in vllm/multimodal/image.py
__init__ ¶
__init__(image_mode: str = 'RGB', **kwargs) -> None
Source code in vllm/multimodal/image.py
_convert_image_mode ¶
_convert_image_mode(
image: Image | MediaWithBytes[Image],
) -> Image
Convert image mode with custom background color.
Source code in vllm/multimodal/image.py
encode_base64 ¶
Source code in vllm/multimodal/image.py
load_base64 ¶
load_base64(
media_type: str, data: str
) -> MediaWithBytes[Image]
load_bytes ¶
load_bytes(data: bytes) -> MediaWithBytes[Image]
load_file ¶
load_file(filepath: Path) -> MediaWithBytes[Image]
convert_image_mode ¶
rescale_image_size ¶
Rescale the dimensions of an image by a constant factor.
Source code in vllm/multimodal/image.py
rgba_to_rgb ¶
rgba_to_rgb(
image: Image,
background_color: tuple[int, int, int] | list[int] = (
255,
255,
255,
),
) -> Image
Convert an RGBA image to RGB with filled background color.