From owner-tiff@olympiakos.com  Sat Jan 29 19:31:17 2000
Received: (from uucp@localhost)
	by smtp02.oce.nl (8.9.3/8.9.3) id TAA21900
	for rvdt@smtp02; Sat, 29 Jan 2000 19:31:17 +0100 (MET)
>Received: from gate7.olympiakos.com ([207.176.88.85])
	by oce.nl (8.9.0/8.9.0) with ESMTP id TAA13599;
	Sat, 29 Jan 2000 19:31:00 +0100 (MET)
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id NAA30885;
	Sat, 29 Jan 2000 13:28:15 -0500
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Sat, 29 Jan 2000 13:27:50 -0500
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id NAA30865
	for tiff-outgoing; Sat, 29 Jan 2000 13:27:50 -0500
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from ns.srz-berlin.de (ns.srz-berlin.de [212.5.11.1])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id NAA30862
	for <tiff@olympiakos.com>; Sat, 29 Jan 2000 13:27:45 -0500
Received: from SunFrame1 (gw.srz-berlin.de [212.5.11.2])
	by ns.srz-berlin.de (8.8.7/8.8.7) with SMTP id TAA05695;
	Sat, 29 Jan 2000 19:27:33 +0100
Message-ID: <38933115.2874@srz-berlin.de>
Date: Sat, 29 Jan 2000 19:27:33 +0100
From: Helge Blischke <H.Blischke@srz-berlin.de>
Organization: SRZ BERLIN
X-Mailer: Mozilla 3.01Gold (X11; I; SunOS 5.5.1 sun4m)
MIME-Version: 1.0
To: Paul Kaiser <buddy@effingham.net>
CC: tiff@olympiakos.com
Subject: Re: tiff2ps: G4 compression in PostScript]
References: <v03130300b4b7ee487663@[216.43.19.88]>
Content-Transfer-Encoding: 7bit
Sender: owner-tiff@olympiakos.com
Content-Type: text/plain; charset=us-ascii

Paul Kaiser wrote:
> 
> I have been investigating the G4 compression issue intensely for the past week.
> 
> Adobe Acrobat will create a PDF using G4 compression for monochrome images
> if so requested. Then, if you export that PDF as PostScript, the image
> still retains G4 compression and uses the /CCITTFaxDecode filter in the
> PostScript code.
> 
> I am therefore using such a PDF exported as PS to compare. The PDF/PS was
> created from a bitmap TIF, and the same bitmap TIF with G4 compression is
> then compared.
> 
> When I compare the image data in the PS file to the actual image data from
> the G4 compressed TIF, they are VERY similar. However:
> -- Every now and then there is extra data in the TIF file compared to the
> data in the PS file.
> 
> I cannot figure out what extra data is written in the TIF file as compared
> to the bitmap data written in the PS file. The G4 specs from ITU specify
> that there may be some padding at the End of the transmission, but that
> doesn't seem to be the problem, as the observed differences are not all at
> the end of the file.
> 
> Anyway, If I figure anything out, I'll let the list know. I hope we can
> crack this one soon; it is very important to me!
> 
> Regards,
> Paul Kaiser
> GoodBuddy Software
> http://www.goodbuddy.net

Paul,

the differences between the Acrobat generated G4 compressed data and the
original G4 TIFF
data are easily explained:

1st, TIFF images are often tiled or made up in strips, where each tile
or strip is compressed
separately (as the TIFF spec requires). An Acrobat compressed image is
much like a TIFF image
made up of a single strip.

2nd, by default Acrobat does not use the uncompressed flag (i.e. there
are no scanlines that
are not compressed, even if compression will bloat this part of the
image.

3rd, by default, Acrobat does not aligne scanlines to byte boundaries.

4th, Acrobat generates an EOFB sequence at the end of the image data.
Though the TIFF
spec does require this as well, I've encountered many G4 compressed TIFF
images which lack
this EOFB - which normally does not matter, as a reader is not required
to theck for this
sequence, but is required to stop decoding if the required number of
scanlines (rows) is
decoded or the EOFB is found (whichever occurs first).

Besides that, the T6 specification is somewhat unclear on the conditions
where the
horizontal encoding mode should change.

Helge
-- 
H.Blischke@srz-berlin.de
H.Blischke@srz-berlin.com
H.Blischke@acm.org

