Xref: utzoo comp.sys.next:2165 comp.lang.postscript:2208 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!apple!ames!ncar!tank!scott@sage.uchicago.edu From: scott@sage.uchicago.edu (Scott Deerwester) Newsgroups: comp.sys.next,comp.lang.postscript Subject: A little PostScript hacking for NeXT screens Message-ID: <3338@tank.uchicago.edu> Date: 19 May 89 14:38:47 GMT Sender: news@tank.uchicago.edu Reply-To: scott@sage.uchicago.edu (Scott Deerwester) Organization: TIRA / UofC Lines: 62 I've been enjoying Scene in both 0.8 and 0.9. As I write this, my screen background is a photograph of a beach with palm trees... if I could only get the DSP to do steel drums... I've done a bit of hacking in PostScript to diddle with the brightness and contrast of images (in the sense of PostScript's "image" operator), and thought that others might be interested in similar diddling. To use this, change x and y to the dimensions of your image, and bits to the number of bits of grey scale (probably either 1 or 8). Brightness ranges from -1 to 1, with lower numbers being darker, and 0 applying no transformation at all to the image. Contrast is similar. Small positive values (ranging from 0.1 to 0.3) for both have given me the best results, especially for images that began life as color photos. Insert your bitmap (a Whole Big Bunch of hex numbers) at the appropriate place. Only caveat that I'm aware of is that if your bitmap doesn't have as many elements as you said it did, you may expect garbage to follow. %!PS-Adobe-1.0 %%BoundingBox: 0.000 0.000 512.000 480.000 % % Author: % Scott Deerwester, University of Chicago % Copyright: % You may freely copy this code, provided that a copy % of this notice is included with all copies. % /x 512 def % Number of columns /y 480 def % Number of rows /bits 8 def % Number of bits of grey scale /brightness 0.3 def /contrast 0.2 def /picstr x string def gsave x y scale { % Uncomment the following line if your image looks like a negative % 1 exch sub brightness 0 ne { dup brightness 0 gt { 1 exch sub } if 9 mul 1 add log brightness mul 1 brightness sub mul add } if contrast 0 ne { dup 360 mul sin contrast mul sub } if } settransfer x y bits [x 0 0 y neg 0 y] {currentfile picstr readhexstring pop} image % Insert your bitmap here grestore