Python Forum
Old style TIF compression
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Old style TIF compression
#1
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
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
#2
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
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
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/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  looking 4 py code: run-length compression Skaperen 2 3,755 Dec-31-2016, 03:17 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