Feb-10-2022, 08:06 AM
(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.