Python Forum
making graphical image files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
making graphical image files
#1
are there modules for making graphical image files in formats like BMP. GIF, JPEG, and PNG? i would be surprised if there are none. but the question i have is how Python programs are expected to hold images before outputting them to files via one of these image formatting modules. and if the Python script is actually constructing the image, is the image intermediate and final result stored the same way as stored when reading the image from a file like BMP. GIF, JPEG, and PNG? IOW, how do you expect to store a pixel, a row of pixels, and/or a 2-D image of pixels?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
PIL (or the better pillow fork of it) and pygame have methods for creating images. I never created an image from scratch, but i have modified an existing image. Actually in pygame you do it all the time to set a colorkey to alpha. You just normally dont save it as a new image.

Pixels are just a shade of color usually RGB. (red, green, blue) for a max of (255,255,255) each pixel. So basically a list of these tuples in a certain order make up an image.
Recommended Tutorials:
Reply
#3
so it's stored as tuples, not as bytes. probably better to work with it that way.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is Python Support Graphical User Interface? ankitdixit 4 2,204 Apr-29-2022, 09:26 PM
Last Post: Axel_Erfurt
  Show pressure data in a nice graphical way? EmG 3 2,348 May-19-2020, 02:53 PM
Last Post: DPaul
  Graphical UI for Windows AndrzejB 1 1,893 Jul-05-2019, 10:34 AM
Last Post: buran
  birdseye - a graphical python debugger Almenon 0 2,990 Mar-31-2018, 10:37 PM
Last Post: Almenon

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020