CMYK PPM Tools

My CMYK tools consist of four files, plus a modified makefile, intended to be dropped into the converter/ppm directory of the 10.26.1 release of NetPBM. Then a simple "make" should build them.

Download netpbm-cmyk.tar.gz (3k).

Conversion methodology for the curious:

    /* RGB -> CMY -> CMYK: 
     *
     * c      = maxval - r
     * m      = maxval - g
     * y      = maxval - b
     *
     * klevel = min(c,m,y)
     *
     * min_k  = maxval / 2
     * if ( klevel >= min_k ) { k = klevel } else { k = 0 }
     *
     * c      = c - k
     * m      = m - k
     * y      = y - k
     *
     * Reverse to go from CMY or CMYK to RGB.
     * Choice of min_k is typically ink dependent.
     */

License

License text from the NetPBM code:

Copyright (C) 1991 by Jef Poskanzer.

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty.

Author

This web page and the CMYK PPM code is by Eli the Bearded / Benjamin Elijah Griffin. Page copyright February 2005, reproduction of text, my code, and images is permitted under the Creative Commons Attribution-ShareAlike License.