diff options
Diffstat (limited to 'Master/texmf-dist/scripts/epspdf/makegray.pro')
-rw-r--r-- | Master/texmf-dist/scripts/epspdf/makegray.pro | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/epspdf/makegray.pro b/Master/texmf-dist/scripts/epspdf/makegray.pro new file mode 100644 index 00000000000..67dc5705839 --- /dev/null +++ b/Master/texmf-dist/scripts/epspdf/makegray.pro @@ -0,0 +1,29 @@ +%! +% makegray.pro, PostScript header file for grayscale conversion. + +%%%%% +% Siep Kroonenberg, n dot s dot kroonenberg at rug dot nl +% Public domain. +%%%%% + +% This version only handles some basic color models, +% and doesn't handle image data at all. +% A more robust version would be warmly welcomed. + +%%%%<< /ProcessColorModel /DeviceGray >> setpagedevice +userdict begin +% .11*B + .59*G + .3*R +/setrgbcolor { + 0.11 mul exch 0.59 mul add exch 0.3 mul add + systemdict begin setgray end +} def +% 1.0 - min(1.0, .3*C + .59*M + .11*Y + B) +/setcmykcolor { + exch 0.11 mul add + exch 0.59 mul add + exch 0.3 mul add + dup 1 gt {pop 1} if + 1 exch sub + systemdict begin setgray end +} def +end |