Learn Before
Concept
Custom Image Decoding (Pillow)
PIllow includes a draft() function for image objects that allows for custom image decoding for images that have been opened, but not yet loaded. The function takes two arguments, the desired color mode and image size, and will load the image to the specifications provided. This can speed up decoding if the arguments specify a simpler color mode or smaller image size.
image = Image.open(filepath) image.draft(mode, size)
0
1
Updated 2021-08-21
Tags
Python Programming Language
Data Science