MCPcopy Index your code
hub / github.com/huggingface/diffusers / convert_to_rgb

Method convert_to_rgb

src/diffusers/image_processor.py:237–251  ·  view source on GitHub ↗

r""" Converts a PIL image to RGB format. Args: image (`PIL.Image.Image`): The PIL image to convert to RGB. Returns: `PIL.Image.Image`: The RGB-converted PIL image.

(image: PIL.Image.Image)

Source from the content-addressed store, hash-verified

235
236 @staticmethod
237 def convert_to_rgb(image: PIL.Image.Image) -> PIL.Image.Image:
238 r"""
239 Converts a PIL image to RGB format.
240
241 Args:
242 image (`PIL.Image.Image`):
243 The PIL image to convert to RGB.
244
245 Returns:
246 `PIL.Image.Image`:
247 The RGB-converted PIL image.
248 """
249 image = image.convert("RGB")
250
251 return image
252
253 @staticmethod
254 def convert_to_grayscale(image: PIL.Image.Image) -> PIL.Image.Image:

Callers 1

preprocessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected