Skip to content

Example PIL #22

@CTPaHHuK-HEbA

Description

@CTPaHHuK-HEbA

https://python-mss.readthedocs.io/en/dev/examples.html#pil
Os Windows

        # Create the Image, solution 1 (slower)
        # img = Image.frombytes('RGB', sct_img.size, sct_img.content)

sct_img.content - no attribute into sct_img

        # Create the Image, solution 2
        img = Image.frombytes('RGBA', sct_img.size, bytes(sct_img.raw), 'raw', 'BGRA')
        img = img.convert('RGB')  # Convert to RGB

Equivalent, which is faster
img = Image.frombytes('RGB', sct_img.size, sct_img.rgb, 'raw')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions