HPInc / jipp

A Java-compatible implementation of IPP
MIT License
153 stars 42 forks source link

PWG-Raster doesn't encode monochrome properly #45

Closed GladeDiviney closed 5 years ago

GladeDiviney commented 6 years ago

When PWG Raster emits monochrome output it should specify this in the ColorSpace setting with enum 18 (grayscale). Instead it always sends 19 (3-byte sRGB).

GladeDiviney commented 6 years ago

https://ftp.pwg.org/pub/pwg/candidates/cs-ippraster10-20120420-5102.4.pdf requires four different attributes to encode monochrome properly:

4.3.2.5 BitsPerColor, BitsPerPixel, ColorSpace, and NumColors

The BitsPerColor, BitsPerPixel, ColorSpace, and NumColors fields MUST be initialized to values corresponding to a “PwgRasterDocumentTypesSupported” value, as defined in Table 12. The choice of values MAY be influenced by the values of the "PrintColorMode", "Quality", and "Resolution" elements in the DocumentProcessing group.

All of these need to be in alignment, not just ColorSpace.