Summary: | /Subsample filter needs to make non-integer scales integer for monochrome images | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | yiwei.she |
Component: | PDF Writer | Assignee: | Ken Sharp <ken.sharp> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P4 | ||
Version: | 9.20 | ||
Hardware: | Macintosh | ||
OS: | MacOS X | ||
Customer: | Word Size: | --- | |
Attachments: | monochrome subsample bug test file |
Description
yiwei.she
2016-11-16 09:02:40 UTC
Created attachment 13149 [details]
monochrome subsample bug test file
(In reply to yiwei.she from comment #0) > According to current documentation at: > http://www.ghostscript.com/doc/9.20/VectorDevices.htm#PDFWRITE, > > the Bicubic filter should be supported for monochrome. No, that's not an option, the documentation clearly has a typo which I'll also fix. Bicubic filtering requires intermediate levels between black and white, so the image would no longer be monochrome, and for imagemasks would no longer be an imagemask. Since the point of downsampling an image is to reduce its size, converting it from 1 bit per pixel to 8 bits per pixel isn't really an excellent plan. Subsampleing *is* the only option which retains the monochrome nature of monochrome images, but I agree that in this case we should either permit a degree of freedom or, since its one level for all images no matter what the size of the image or its original resolution, clamp to the nearest integer value. The subsample filter also not rounding when the ration is within .1 of an integer; in the error the ratio is (3.017893). commit b880332b899e0e59d17c7e48033e5cc816e5a831 will now force the downsample factor to an integer when the input is a 1 BPP image or imagemask (so we cannot shift to a Bicubic filter) and the downscale factor is not precisely an integer. Also fixed the mistake in the documenttion. |