Raster file generation

Michael Sweet mike at easysw.com
Fri Feb 9 08:05:15 PST 2007


Nathan Whitehorn wrote:
> ...
>> You're generating 32-bit KCMY data, but the rastertohp filter only 
>> handles 4-bit KCMY data.
> 
> Is there any way to determine the desired bit depth? I'm also not
> sure if there's a recommended way to convert to 4-bit KCMY (should I
> just round myself, or is there a utility function for doing this kind
> of thing?).
 > ...

The bit depth is passed via the cupsBitsPerColor page attribute;
if you use one of the standard PPDs included with CUPS along with
cupsRasterInterpretPPD(), the page header will show a cupsBitsPerColor
value of 1.

As for dithering, there are no recommended algorithms but using
either a simple ordered dither (like imagetoraster does) or a
Floyd-Steinburg error-diffusion dither (like Apple's cg*toraster
filters do) will be sufficient for most devices.

-- 
______________________________________________________________________
Michael Sweet, Easy Software Products           mike at easysw dot com
Internet Printing and Publishing Software        http://www.easysw.com




More information about the cups mailing list