Python Forum
reading and writing a image stored in a file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reading and writing a image stored in a file
#1
there seem to be many libraries to read and write images from and to a file or other storage, as found on duckduckgo. i wonder which you would recommend. my preferences would be wide variety of storage formats (i only need to do files), ease of use, commonly used in Python community, compatible with other graphics tools usable in Python.
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
Hi Skaperen,

I do a fair amount of image manipulation, but I do not
understand your question.
To move files from one place to another, copy/paste will do.
But i'm sure you want something else. Smile
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#3
i want to read an image from a file, manipulate the pixels in the Python code (to be developed), and write the image to a file. i expect to get the geometry of the file when i read it in.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
(Jan-29-2022, 01:25 AM)Skaperen Wrote: i want to read an image from a file, manipulate the pixels in the Python code (to be developed), and write the image to a file. i expect to get the geometry of the file when i read it in.

The problem is the *type* of file.
You first need to extract the image file per its image type.

For epub (and Word) you may need to use a zip library to extract any or all jpg or png files. process them, snd either rearchive them or relocate.
PDFs are a bit more complicated but there are tools for extracting their images. You may need an editor to replace.

So answers will depend on file and image types, as well as destination after mods.
Reply
#5
(Feb-10-2022, 08:06 AM)millpond Wrote: You first need to extract the image file per its image type.
if by type you mean how the pixels are encoded into an 8-bit (bytes) file, such as GIF, JPEG, or PNG (to name a small subset). i call these "storage formats". i hope to have a wide range of support. i hope there is automatic detection so most files provided by most people will just work. it would be nice for the API to indicate the type so my code can provide the result in the same format.
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
  reading a file like the unix tail -f command does Skaperen 2 297 Mar-31-2024, 12:09 AM
Last Post: Skaperen
  creating an unlinked invisible file, writing it, then linking it Skaperen 2 1,308 Feb-21-2023, 05:40 PM
Last Post: Skaperen
  reading remote active log file? korenron 3 2,883 Jun-24-2021, 09:07 AM
Last Post: korenron
  tools for writing and reading binary data in files Skaperen 0 1,470 Jun-08-2020, 07:28 PM
Last Post: Skaperen
  reading an f-string from a file Skaperen 4 5,072 Nov-03-2019, 01:59 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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