There is code in pdfwrite which disables subsampling and lossy compression when a non-identity transfer function is detected. This change was made for bug #420257 some considerable time ago. This does result in some situations where less than optimal output is generated. It would be nice, if possible, to detect the situation better, or possibly remove the detectio altogether if no longer required.
Created attachment 3456 [details] This is level 1 output containing an image with a fake /Indexed space
Regarding Comment #1 : The file starts with "%!PS-Adobe-3.0", so I'm not sure whether it's really level 1. Later there is DSC comment "%%LanguageLevel: 1". I tried this : gswin32c.exe -r144 -dBATCH -d/DEBUG -c 1 .setlanguagelevel -f cowgifword.ps and got /dictfull in definefont. It's another bug though.
As I understand it, the %!PS-Adobe-3.0 refers to the version of Document Structure Convention which the file conforms to, it doesn't by itself indicate any particular PostScript language level. SO I think this means its a DSC 3.0 file. I'd go with the %%LanguageLevel: 1 comment which ties up with the DIB ProcSet comment. I can't really say why you would get a dictfull in definefont, but language level 1 implementations varied considerably, many implemented extensions which weren't part of the original language. I don't know what limitations Ghostscript imposes if you force language level to 1....
Dictionaries that automatically expand are a Level 2 feature. When Ghostscript is set to emulate Level 1, it disables the automatic growth of dicts, so that PS that relies on this will get an error (just as they would on a Level 1 printer). Generally, you don't want to change the languagelevel, and GS should be able to handle the PSCRIPT.DLL output without this. I'd recommend against trusting the DSC comments to execute a .setlanguagelevel since DSC comments are notoriously unreliable. I'm not sure that special handling in pdfwrite for this type of Level 1 (ab)use is worth optimizing. Subsampling seems like it should be safe.
The issue isn't really with level 1 internally, more to do with processing the result of selecting a level 1 device with this driver. Although it seems that subsampling should be safe, when I tried it with this job I got garbage output (Really garbage, not just problems with Acrobat not applying the transfer function). Its probably not worth looking at, but maybe one day....
Assigning to the owner of this area. Priority is still low, and this enhancement may never be done.
Enhancement still missing in Ghostscript 9.03
This is now done in commit 0bc05670e841517b8a2041999c19c19507874a4a If we have either an Indexed colour space, or a non-identity transfer function we temporarily set the downsampling to Subsample (but don't otherwise enable it) and the compression to 'lossless'. This means that these kinds of input can now use downsampling and benefit from compression, resulting in smaller output PDF files.