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
#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


Messages In This Thread
RE: reading and writing a image stored in a file - by millpond - Feb-10-2022, 08:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  reading a file like the unix tail -f command does Skaperen 2 447 Mar-31-2024, 12:09 AM
Last Post: Skaperen
  creating an unlinked invisible file, writing it, then linking it Skaperen 2 1,369 Feb-21-2023, 05:40 PM
Last Post: Skaperen
  reading remote active log file? korenron 3 2,967 Jun-24-2021, 09:07 AM
Last Post: korenron
  tools for writing and reading binary data in files Skaperen 0 1,493 Jun-08-2020, 07:28 PM
Last Post: Skaperen
  reading an f-string from a file Skaperen 4 5,207 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