Newsgroups: comp.graphics,comp.lang.postscript,comp.graphics.algorithms,sci.image.processing
Path: cantaloupe.srv.cs.cmu.edu!rochester!rit!isc-newsserver!edison!jsvrc
From: jsvrc@rc.rit.edu (J A Stephen Viggiano)
Subject: Re: Transfer function or calibration
Message-ID: <1994Nov14.163238.24427@ultb.isc.rit.edu>
Originator: jsvrc@edison
Sender: jsvrc@rc.rit.edu (J A Stephen Viggiano)
Nntp-Posting-Host: edison.rc.rit.edu
Organization: RIT Research Corp. Rochester, NY
References: <3a1f45$cjr@hobbes.cc.uga.edu>
Date: Mon, 14 Nov 1994 16:32:38 GMT
Lines: 68
Xref: glinda.oz.cs.cmu.edu comp.graphics:64405 comp.lang.postscript:28281 comp.graphics.algorithms:10169 sci.image.processing:10880

In article <3a1f45$cjr@hobbes.cc.uga.edu> tchang@aisun6.ai.uga.edu (Tony Chang [guest]) writes:
>I am trying to build a calibration/transfer function utility; just like
>the one in PhotoShop (put in diff. numbers for each colors...etc).
>However, I don't quite understand how to 'build' (generate) the curve
>based on the numbers I putted in.  Which algorithm should I used?
>Any hints/suggestions regarding this matter will be appreciated.

In order to build a transfer function for binary Postscript printer, you
need to select some linearization criterion. We often use the halftone
dot area on paper, as calculated using the Yule-Nielsen equation using an
n-value of 2.0. Be aware that the "setgray" operator actually works in
reverse, so "0.25 setgray" is actually asking for a 75% dot.

Our experience indicates that the response of most binary printers follows
the GRL Dot Gain Model, published in _1983_TAGA_Proceedings_, to within
quantization error caused by the often limited number of gray levels.
This model provides the halftone dot area on paper as a function of the
desired halftone dot area. It contains a single parameter, the difference
at 50% desired dot area:

	ap = Max (0, Min (1, af + 2 * g50 * sqrt (af * (1 - af))))

where	af is the desired halftone dot area;
	g50 is the characteristic gain (the gain for a 50% desired dot);
and	ap is the halftone dot obtained on the paper.

This function is invertible, and we have built it into Postscript
procedures. Remember to complement the input at the beginning of the
procedure (because the settransfer operator will be provided with the
complement of the desired dot area) and to complement the result before
returning it (because the complement of the halftone dot area is expected).

Not in every case will you have a transfer function in closed form; you'll
have a linearization table: a table of output values as a function of
input values. The first thing you should do is fully populate it for at
least 8 bits of addressibility, so it contains at least 256 entries, all
evenly spaced in terms of input. The settransfer procedure you use
multiplies the input by 255, uses this result as the index into your
array of output values, and returns the output value.

Here's an example of how to do this:

/OldTransfer currenttransfer def

{OldTransfer 255 mul [0.000 0.006 0.012 0.017 0.022 % 249 values deleted
0.997 1.000] exch get} bind settransfer

This code fragment first preserves the existing transfer function before
clobbering it with the new one. This is important, because your
calibration was performed with the old transfer function in place (unless
you clobbered it first). Anyway, it's considered good manners to do so.

For color printers, the process is more complicated. First of all, the
linearization criterion is less objective. Nevertheless, you could
still choose to make dot area on paper linearly related to desired
dot area. The halftone tints should be measured through a narrowband
complementary filter, preferably ISO Status A.

The color analog of the settransfer operator is setcolortransfer. It
is discussed in the Red Book, second edition.



-- 
Having fun at NARAM-37 should be easier than pronouncing "Geneseo".
========================================================================
John Viggiano, jsvrc@rc.rit.edu or sjvppr@ritvax.isc.rit.edu
NAR 25615                                       I'm the NAR, and I vote!
