Python Forum
Old style TIF compression - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Bar (https://python-forum.io/forum-27.html)
+--- Thread: Old style TIF compression (/thread-38747.html)



Old style TIF compression - DPaul - Nov-19-2022

Hi,
I have come across a huge batch of tifs, scanned a long time ago.
When opened in the normal fashion with PIL:
img = Image.open(scanPath)
they give an error : "jpeg old style compression",
many internet topics talk about this problem.
After many tests, I found a way :
import tiffile as tiff 
import numpy as np
...
a = tiff.imread(scanPath)
img = Image.fromarray(np.uint8(a))
# the above img I can show()
Question: I am using this method as of now, to also read the normal LZW compressed images.
WIll I be punished for using this overhead (response time, memory usage...) ?
Or ... is there another and better approach?
Paul


RE: Old style TIF compression - DPaul - Nov-24-2022

Hi,
Nobody seems to know about 'jpeg old style compression' Smile
I can believe that, and it is readable with the code above;
BUT, problem:
pyinstaller does not like it, while executing in IDLE from the source code, works perfectly.
I'm trying to figure out what is wrong, because the executable does not show the tif scans.
Question:
the pyinstaller report shows many things that are "missing", but i understand that is always
the case and not a showstopper.
So how do i detect in this mess what is really wrong, must i look for a special message ?
thx,
Paul


RE: Old style TIF compression - Larz60+ - Nov-24-2022

You can find a lot of good info on image compression types on google scholar searching for 'compressed image file formats'
There's a lot of legacy material here, as well as the new, most of it free, although the more recent material may be considered academic property and have a charge attached.
Lot of good reads here.
https://scholar.google.com/