Bug 688786 - documentation bug: -dAutoFilterColorImages=true/false has no effect
Summary: documentation bug: -dAutoFilterColorImages=true/false has no effect
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Writer (show other bugs)
Version: 8.54
Hardware: PC Linux
: P4 normal
Assignee: leonardo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-10 08:28 UTC by Hin-Tak Leung
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Tak Leung 2006-07-10 08:28:42 UTC
I have a ps which is essentially a big color image, and both
ps2pdf -dAutoFilterColorImages=false myfile.ps
and
ps2pdf -dAutoFilterColorImages=true myfile.ps
DCTEncode the image (and thus lead to quality loss).

I have to do 
ps2pdf -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode  
myfile.ps

to have the desired lossless compression.

This is somewhat different from expected, reading the documentation
(ps2pdf.htm):
=================
(note 1) Currently, AutoFilterxxxImages doesn't examine the image to decide
between JPEG and LZW or Flate compression: it always uses Flate compression. 
If you want to force JPEG compression, use -dAutoFilterxxxImages=false.
=================
I was expecting FlateEncode to be on when AutoFilterColorImages=true (the default).

file to follow.
Comment 1 Hin-Tak Leung 2006-07-10 08:32:34 UTC
Created attachment 2337 [details]
ps file gzip'ed

ps file gzip'ed for which I had the problem with reading the docs.
Comment 2 Hin-Tak Leung 2006-07-10 08:46:25 UTC
If my reading of lib/gs_pdfwr.ps is correct, the defaults are:

<<
/AutoFilterColorImages true
/MonoImageFilter /CCITTFaxEncode
/ColorImageFilter /DCTEncode
>>

whereas my understanding of what the doc says the default (not true) are 
these:

<<
/AutoFilterColorImages true
/MonoImageFilter /FlateEncode
/ColorImageFilter /FlateEncode
>>
Comment 3 leonardo 2006-08-11 04:36:46 UTC
1. The comment#2 is incorrect.
Both gs/doc/Ps2pdf.htm and "Acrobat Distiller Parameters October 2, 2005
Adobe Solutions Network — http://partners.adobe.com" specify the default value 
for ColorImageFilter is DCTEncode.

2. In gs/doc/Ps2pdf.htm "note 1" appears obsolete. I'll remove it.

3. When AutoFilterColorImages=true, the filter is being choosed automatically. 
Ghostscript chooses DCTDecode and Distiller chooses DCTDecode. Thus 
Ghostscript's behavior is same as Adobe.

4. I agree that a looseless filetr may be better for this image for some 
purposes, when the text contrast is highly important. But for outher purposes, 
when the document size is more important, DCTEncode is preferrable. Thus there 
is not enough reason to improve the automatic filter choice.
Comment 4 leonardo 2006-08-11 04:51:25 UTC
Patch to HEAD :
http://ghostscript.com/pipermail/gs-cvs/2006-August/006744.html
Comment 5 Hin-Tak Leung 2006-08-11 11:41:05 UTC
I was just refering to gs/doc/Ps2pdf.htm "note 1" on 
"what the doc says" in comment 2 - anyway, note 1 was wrong and removal/rewrite 
is fine.