-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Labels
Description
What did you do?
Called PIL.Image.Image.convert(mode='LAB') for an RGB image
img = PIL.Image.open('filename.png').convert(mode='LAB')What did you expect to happen?
Conversion of data to LAB colourspace.
What actually happened?
ValueError: conversion from RGB to LAB not supported
The following code did work:
rgb_lab_transform = PIL.ImageCms.buildTransformFromOpenProfiles(PIL.ImageCms.createProfile('sRGB'), PIL.ImageCms.createProfile('LAB'), 'RGB', 'LAB')
img = PIL.ImageCms.applyTransform(Image.open('filename.png').convert(mode='RGB'), rgb_lab_transform)What are your OS, Python and Pillow versions?
- OS: Linux, kernel 5.15.32-gentoo-r1
- Python: 3.10.6
- Pillow: 9.2.0