Skip to content

Conversion P to L wrong? #5728

@CTPaHHuK-HEbA

Description

@CTPaHHuK-HEbA
from PIL import Image

img = Image.open('p.png')
print('P->L: ', img.convert('L').getpixel((0, 0)))
print('P->RGB: ', img.convert('RGB').getpixel((0, 0)))
print('P->RGB->L: ', img.convert('RGB').convert('L').getpixel((0, 0)))

p.png: p

Old
PIL: 6.2.2
P->L: 175
P->RGB: (177, 175, 175)
P->RGB->L: 175

7.0.0+
After commit #4320
PIL: 8.3.2
P->L: 175
P->RGB: (177, 175, 175)
P->RGB->L: 176

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions