AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
January 2019

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2019.01.12 17:25 "tiffcp altering image contents (in contrast to what the manual says)?", by <lists@binarus.de>
2019.01.12 19:09 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by Bob Friesenhahn
2019.01.12 21:07 "Re: Tiff Digest, Vol 3, Issue 3", by Richard Nolde
2019.01.13 15:41 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by <lists@binarus.de>
2019.01.13 19:24 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by Bob Friesenhahn
2019.01.13 17:04 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by <lists@binarus.de>
2019.01.13 18:31 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by <lists@binarus.de>
2019.01.13 19:17 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by Bob Friesenhahn
2019.01.13 21:58 "Re: tiffcp altering image contents (in contrast to what the manual says)?", by <lists@binarus.de>

2019.01.12 21:07 "Re: Tiff Digest, Vol 3, Issue 3", by Richard Nolde

On 1/12/19 1:00 PM, tiff-request@lists.osgeo.org wrote:
> Send Tiff mailing list submissions to
> 	tiff@lists.osgeo.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.osgeo.org/mailman/listinfo/tiff
> or, via email, send a message with subject or body 'help' to
> 	tiff-request@lists.osgeo.org
>
> You can reach the person managing the list at
> 	tiff-owner@lists.osgeo.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tiff digest..."
>
>
> Today's Topics:
>
>    1. tiffcp altering image contents (in contrast to what the
>       manual says)? (Binarus)
>    2. Re: tiffcp altering image contents (in contrast to what the
>       manual says)? (Bob Friesenhahn)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 12 Jan 2019 18:25:46 +0100
> From: Binarus <lists@binarus.de>
> To: tiff@lists.osgeo.org
> Subject: [Tiff] tiffcp altering image contents (in contrast to what
> 	the	manual says)?
> Message-ID: <0383083a-fbcb-d6cb-8a37-1725f6939063@binarus.de>
> Content-Type: text/plain; charset=utf-8
>
> Dear all,
>
> I have four multi-page TIFF files (with names 1.tif, 2.tif, 3.tif and
> 4.tif) which I would like to combine into one multi-page TIFF file
> WITHOUT re-encoding them (more exactly: without re-encoding the pages /
> images they contain).
>
> Each of the single pages IN A CERTAIN source file has the same color
> depth, compression scheme and compression scheme parameters. The color
> depth, compression scheme and compression parameters are different
> between the source files, though, as the following table shows:
>
> 1.tif: 7.75 MB  / 24 BPP / JPEG / 4 pages (images)
> 2.tif: 315 KB   /  1 BPP / ZIP  / 4 pages (images)
> 3.tif: 13,94 MB / 24 BPP / JPEG / 8 pages (images)
> 4.tif: 127 KB   /  1 BPP / ZIP  / 2 pages (images)
>
> The combined size of the source files is about 22.12 MB.
>
> As noted above, my goal is to merge the source files WITHOUT RE-ENCODING
> or touching the image data otherwise. I have tried to do this for
> several days now, but every tool I know obviously decodes each page to a
> representation in memory first and then outputs the pages, re-encoding
> them.
>
> Then, by accident, I stumbled across tiffcp, which I didn't know until
> then, and which seems to be part of libtiff, and which let me hope due
> to the following sentence in the manual (man tiffcp):
>
> "tiffcp can be used to reorganize the storage characteristics of data in
> a file, but it is explicitly intended to not alter or convert the image
> data content in any way."
>
> So I tried
>
> tiffcp 1.tif 2.tif 3.tif 4.tif out.tif
>
> I was very disappointed when I noticed that out.tif had a size of 13.55
> MB. This size reduction (from 22.12 MB to 13.55 MB) is by far too much
> to be explained by "pure merging effects". Hence, I am convinced that
> tiffcp DOES alter the image data in some way, although the manual states
> the opposite.
>
> I would be very grateful if somebody could shed some light onto this
> issue.
>
> Thank you very much in advance,
>
> Binarus
>
>
> ------------------------------
>
> Message: 2
> Date: Sat, 12 Jan 2019 13:09:55 -0600 (CST)
> From: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
> To: Binarus <lists@binarus.de>
> Cc: tiff@lists.osgeo.org
> Subject: Re: [Tiff] tiffcp altering image contents (in contrast to
> 	what the manual says)?
> Message-ID:
> 	<alpine.GSO.2.20.1901121308590.14882@freddy.simplesystems.org>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> On Sat, 12 Jan 2019, Binarus wrote:
>> I would be very grateful if somebody could shed some light onto this
>> issue.
> Are you able to supply 'tiffinfo' output for all of the input files 
> and the output file?
>
> It may be that the JPEG has been re-encoded.
>
> Bob

It's been quite a while since I've looked at the source code to tiffcp,
but I seem to remember that OLD JPEG encoding is no longer supported in
the output stage so most likely what is happening is that the data is
being re-encoded in new JPEG format. Here is a note from the tiffcrop
man page that makes this explicit:

 JPEG
       compression  is  only  usable  on 8 bit per sample data (or
12
bit if LibTIFF was compiled with 12 bit JPEG support). Support for
       OJPEG compressed images is problematic at best. Since OJPEG
compression is no longer supported for writing images  with  LibTIFF,
       these  images will be updated to the newer JPEG compression
when
they are copied or processed. This may cause the image to appear
       color shifted or distorted after conversion.  In some cases,
it
is possible to remove the original compression  from  image  data
       using the option -cnone.

When I wrote tiffcrop, I was aware of this issue and added the paragraph
above to the man page for tiffcrop.

Richard Nolde, author of tiffcrop



_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff