Path: utzoo!attcan!uunet!yale!cmcl2!phri!roy From: roy@phri.UUCP (Roy Smith) Newsgroups: comp.lang.postscript Subject: Question on settransfer operator Message-ID: <3648@phri.UUCP> Date: 12 Jan 89 17:06:13 GMT Organization: Public Health Research Institute, NYC, NY Lines: 27 When defining a transfer function, is it important to ensure that the result is strictly in the range of 0-1? What happens if it's not? Here's my problem: I want to do contrant enhancement on an image with 8-bit values (i.e. from 0-255), most of which fall in the central range. What I want to do is pick the 10% and 90% points and stretch them to be the full 0-255 range (i.e. I'm willing to put up with clipping at the top and bottom to get more mid-range contrast). This means that if I just do (30 is the 10% point, 185 is the 90% point, 30/255 = .1176, 255/(185-30) = 1.645): { 0.1176 sub 1.645 mul } settransfer I will ocassionally return values less than 0 or greater than 1. Does postscript automatically truncate grays to the 0-1 range or do I have to use: { 0.1176 sub 1.645 mul dup 0 lt {pop 0} if dup 1 gt {pop 1} if } settransfer to ensure that the result stays within the legal range? -- Roy Smith, System Administrator Public Health Research Institute {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net "The connector is the network"