[Python] conveting bytes to image using tinytag and PIL

Discussão em 'Python' iniciado por Stack, Maio 21, 2025.

  1. Stack

    Stack Membro Participativo

    I am using tinytags module in python to get the cover art of a mp3 file and want to display or store it. The return type of the variable is showing to be bytes. I have tried fumbling around with PIL using frombytes but to no avail. Is there any method to convert the bytes to image?

    from tinytag import TinyTag
    tag = TinyTag.get("03. Me, Myself & I.mp3", image=True)

    img = tag.get_image()

    Continue reading...

Compartilhe esta Página