Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5981331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:55:45+00:00 2026-05-22T21:55:45+00:00

First I’m going to explain what I’m trying to do and then explain my

  • 0

First I’m going to explain what I’m trying to do and then explain my problem.

Okay so I’ve been making prototypes on a project that I hope to be working on over the summer. The project is a small media player and one of the requirements is to display the albulm artwork of an mp3 file.

After some research I found this library:
http://code.google.com/p/mutagen/

The reason I chose this library was because it doesn’t have any dependencies and it would make my application more portable.

After fidilling around with the code I was able to retrieve data from the mp3 file, such as the artist and recording year etc. I’ll give a little demonstration here:

from mutagen.mp3 import MP3
audio = MP3("born.mp3")
artist = audio["TPE1"]
print artist

In case this doesn’t make much sense, this is the tutorial that is provided by mutagen – http://code.google.com/p/mutagen/wiki/Tutorial (its a little bit short)

Problem – I want to display the image using pygame. Normally this would read something like this:

 monkey = pygame.image.load("monkey.jpg")

 screen.blit(monkey,(0,0))

but instead I want to do use the image from the image file. So going from the first example it reads something like:

audio = MP3("born.mp3")
data = audio.tags['APIC:'].data
monkey = pygame.image.load(data)

but pygame throws an exception error because the data type of the variable ‘value’ is raw image data as a byte string.

Question – Is it possible to convert the byte string to some sort of image format so pygame can use it?

For python documentation on images – http://www.pygame.org/docs/ref/image.html

I’m not sure if it is even possible to do what I am asking so please forgive me!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:55:45+00:00Added an answer on May 22, 2026 at 9:55 pm

    Have you tried pygame.image.fromstring()?

    note: since it’s raw data, you’ll need to know in advance a few details such as the resolution and colour depth.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First I want to explain what am I doing and then my problem. I
First off, I'm working on an app that's written such that some of your
First I will show you example tables that my issue pertains to, then I
First problem is that I do not know how to get the values of
First let me say that I really feel directionless on this question. I am
first post here so sorry for the length of it. I've been lurking and
First of all: this is not a homework assignment, it's for a hobby project
First, I created a xcode project and copied and pasted the CSS and javascript
This is beyond both making sense and my control. That being said here is
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.