Hi all
I've used scantailor to process some images and it outputs the files in TIF (JPEG) format (LZW, deflate, packbit, none or JPEG)
Can imagemagick extract the JPEG data and write to a JPEG file without having to re-compress the data within ? I.e. a lossless conversion from JPEG compressed TIF to just JPEG ?
I wrote a small python script that successfully extracted the JPG byte data from TIF (oldJPEG) but I don't think that works for newer JPG TIF as I understand they hold the 'tables' in a different part of the file and it's not a simple wrapper -- hence if imagemagick 'understands' the file, maybe it can rip the JPG data out to a new file ?
Or any other utils ?
Thanks
Extract JPEG from JPG Compressed Tif
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Extract JPEG from JPG Compressed Tif
A simple test ...
... shows that, as expected, IM unpacks the jpeg then re-packs it.
I expect some tool can do this, but I don't know of one.
Code: Select all
F:\web\im>%IM%convert logo: -compress jpeg l.tiff
F:\web\im>%IM%convert l.tiff j.jpg
F:\web\im>%IM%compare -metric RMSE l.tiff j.jpg NULL:
1459.72 (0.0222738)
I expect some tool can do this, but I don't know of one.
snibgo's IM pages: im.snibgo.com
-
- Posts: 59
- Joined: 2009-01-30T03:46:08-07:00
Re: Extract JPEG from JPG Compressed Tif
Thanks for the confirmation. It's probably workable, but obviously not ideal.