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


Messages In This Thread
Old style TIF compression - by DPaul - Nov-19-2022, 02:31 PM
RE: Old style TIF compression - by DPaul - Nov-24-2022, 09:17 AM
RE: Old style TIF compression - by Larz60+ - Nov-24-2022, 10:44 AM

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