%!PS % Dodges & Burns for your Digital Camera #17 % ========================================== % by Don Lancaster % Copyright c 2002 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % Linking welcome. Reposting expressly forbidden. % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.1 % A tutorial on using dodbur01.psl dodge and burn utilities. % IMPORTANT NOTE: Don Lancaster's file gonzo.ps is required for this program. % After obvious location mods, uncomment ONE of the following two lines: (C:\\windows\\desktop\\gonzo\\gonzo.ps) run % use internal gonzo % (A:\\gonzo.ps) run % use external gonzo % NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES. % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990, 1996, 2001 by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (928) 428-4073 don@tinaja.com support % via http://www.tinaja.com All commercial rights and all electronic % media rights **FULLY** reserved. Reposting is expressly forbidden. %%%%%%%%%%% links menu directory %%%%%%%%%%%% % This code locks pdfmark commands out of a PostScript printer. /pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse % /surl "start url" marks the beginning of a text sequence to be urled. % It also paints the text blue... /surl {mark /blue cvx 0.33 /setgray cvx % change text to blue /currentpoint cvx % remember box start /urly /exch cvx /store cvx /urlx /exch cvx /store cvx ] cvx % complete deferred command printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def % /eurl "end url" unmarks the end of a text sequence and sets up % the pdfmark needed to define the Acrobat web link. /eurl {mark % start deferred proc exch % position url string % /black cvx 0 /setgray cvx % turn blue marker off % maintextcolor /setrgbcolor cvx % reset to main text color??? /aqua cvx /black cvx /makeurl cvx % defer call of url builder ] cvx % complete deferred proc printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch % increment gonzo list count } def % /makeurl generates the pdfmark, receiving a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /urlover 0.2 def % fraction of hot area over bounds /makeurl { /cururlname exch store % save the url string mark % start pdfmark currentfont /ScaleMatrix get 3 get /fsize exch store % guess height /Rect [ urlx fsize urlover mul sub % set box left x urly fsize urlover mul sub % set box left y currentpoint exch fsize urlover mul add exch fsize add ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % /makeurlx generates the box specific pdfmark, receiving % a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /makeurlx { /cururlnamex exch store % save the url string mark % start pdfmark /Rect [ xpos % set box left x ypos 0.9 sub % set box left y xpos 2.8 add % box right x ypos 0.9 sub 2.8 add % box right y ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def /maintextcolor {0 0 0 } def % text link specific data -- use dictionary instead below { /cubic01 {(http://www.tinaja.com/cubic01.asp) eurl} def /hack62 {(http://www.tinaja.com/glib/hack62.pdf) eurl} def /increment {(http://www.tinaja.com/text/bezgen3.html) eurl} def /interpolate {(http://members.bellatlantic.net/~vze2vrva/design.html) eurl } def /bezmath {(http://www.tinaja.com/text/bezmath.html) eurl } def /table {(http://www.tinaja.com/psutils/imtable.psl) eurl } def } pop % dictionary method << %zzzzz %%%% unused links have been commented for gg9a simplicity /bmprpt01 (http://www.tinaja.com/psutils/bmprpt01.psl) /nowhit01 (http://www.tinaja.com/psutils/nowhit01.psl) /blender (http://www.tinaja.com/psutils/blender.psl) /speedup2 (http://www.tinaja.com/glib/speedup2.pdf) /histog01 (http://www.tinaja.com/psutils/histog01.psl) /imgviewer32 (http://www.arcatapet.net/imgv32.cfm) /basis (http://www.tinaja.com/glib/basis.pdf) /expbmp (http://www.tinaja.com/glib/expbmp.pdf) /dodbur01 (http://www.tinaja.com/psutils/dodbur01.psl) /magfill1 (http://www.tinaja.com/psutils/magfill1.psl) /swingt01 (http://www.tinaja.com/psutils/swingt01.psl) /before01 (http://www.tinaja.com/images/bargs/marcon01.jpg) /during01 (http://www.tinaja.com/images/bargs/marcon01.bmp) /after01 (http://www.tinaja.com/images/bargs/marconz1.jpg) /repobmp (http://www.tinaja.com/glib/repobmp.pdf) /basis01 (http://www.tinaja.com/glib/basis.pdf) /arcata (http://www.arcatapet.net/imgv32.cfm) /comparebmp (http://www.designer-info.com/Writing/bmp_tiff_jpeg_gif.htm) /imagimag (http://www.tinaja.com/glib/imagimag.pdf) /myebays (http://www.tinaja.com/glib/myebays.pdf) /stepprep (http://www.tinaja.com/glib/stepprep.pdf) /aafont01 (http://www.tinaja.com/aafont01.asp) /here1 (http://village.infoweb.ne.jp/~fwhw1257/study/bmpform.htm) /here2 (http://www.daubnet.com/formats/BMP.html) /bittype (http://www.tinaja.com/psutils/pdf2bmp.psl) /photocombine (http://www.tinaja.com/psutils/blender.psl) /psl (http://www.tinaja.com/psutils/) % dummy temp /psl1 (http://www.tinaja.com/psutils/pdf2bmp.psl) /psl2 (http://www.tinaja.com/psutils/acatdata.psl) /psl3 (http://www.tinaja.com/psutils/catwords.psl) /psl4 (http://www.tinaja.com/psutils/graburls.psl) /psl5 (http://www.tinaja.com/psutils/blender.psl) /psl6 (http://www.tinaja.com/psutils/catools1.psl) /psl7 (http://www.tinaja.com/psutils/strconv.html) /psl8 (http://www.tinaja.com/psutils/bodcat.psl) /psl9 (http://www.tinaja.com/psutils/flatvue1.psl) /psl10 (http://www.tinaja.com/psutils/fern2img.psl) /psl11 (http://www.tinaja.com/psutils/flutools.psl) /psl12 (http://www.tinaja.com/psutils/mscal156q.psl) /psl13 (http://www.tinaja.com/psutils/weblogu2.psl) /psl14 (http://www.tinaja.com/psutils/pfa2pfb.psl) /psl15 (http://www.tinaja.com/psutils/pfb2pfa.psl) /psl16 (http://www.tinaja.com/glib/psdisk03.psl) /psl17 (http://www.tinaja.com/psutils/disktool.psl) /psl18 (http://www.tinaja.com/glib/psinscrt.psl) /psl19 (http://www.tinaja.com/glib/pssearch.psl) /psl20 (http://www.tinaja.com/text/refsum1.html) /psl21 (http://www.tinaja.com/text/reflog1.html) /psl22 (http://www.tinaja.com/psutils/reflog1.psl) /psl23 (http://www.tinaja.com/psutils/refsum1.psl) /psl24 (http://www.tinaja.com/psutils/searepl.psl) /psl25 (http://www.tinaja.com/psutils/weberru2.psl) /psl26 (http://www.tinaja.com/psutils/grabsrch.psl) /psl27 (http://www.tinaja.com/psutils/grabrefs.psl) /magsn01 (http://www.tinaja.com/magsn01.asp) /gonzoutils (http://www.tinaja.com/post01.asp#gonzo) /disktool (http://www.tinaja.com/psutils/disktool.ps) /elesimp (http://www.tinaja.com/glib/elesimp.pdf) /tn5603 (http://partners.adobe.com/asn/developer/pdfs/tn/TN5603.Filters.pdf) /fern2img (http://www.tinaja.com/psutils/fern2img.psl) /fern (http://www.tinaja.com/psutils/fern2img.pdf) /oldfern (http://www.tinaja.com/psutils/fernx1.pdf) /acrosdk (http://partners.adobe.com/asn/developer/acrosdk/main.html) /refman2 (http://partners.adobe.com/asn/developer/pdfs/tn/psrefman.pdf) /refman3 (http://partners.adobe.com/asn/developer/pdfs/tn/PLRM.pdf) /s3011 (http://partners.adobe.com/asn/developer/pdfs/tn/PS3010and3011.Supplement.pdf) /s2011 (http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/ps2011.supplement.pdf) /s2012 (http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/ps2012.supplement.pdf) /s2013 (http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/ps2013.supplement.pdf) /s2014 (http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/ps2014.supplement.pdf) /s2015 (http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/ps2015.supplement.pdf) /s2016 (http://ftp.ktug.or.kr/obsolete/info/adobe/devtechnotes/pdffiles/ps2016.supplement.pdf) /ghost (http://www.cs.wisc.edu/~ghost/) /distlang (http://www.tinaja.com/psutils/distlang.html) /adobepst (http://partners.adobe.com/asn/developer/technotes/) /maildon (mailto:don@tinaja.com) /tinaja (http://www.tinaja.com) /adobe (http://www.adobe.com) /adobesdk (http://partners.adobe.com/asn/developer/acrosdk/main.html) /pstrans (http://www.tinaja.com/glib/pstrans.pdf) /borland (http://www.borland.com/products/downloads/download_cbuilder.html) /ebay (http://cgi6.ebay.com/ws/eBayISAPI.dll?ViewSellersOtherItems&userid=abeja&completed=0&sort=2&since=-1&include=0&page=1&rows=100) /searepl (http://www.tinaja.com/psutils/searepl.psl) /aasdk (http://www.tinaja.com/plugins/AboutAcrobatSDK.api) /uncomp (http://www.tinaja.com/plugins/UncompressPDF.api) /addimage (http://www.tinaja.com/plugins/AddImage.api) /samplejpg (http://www.tinaja.com/plugins/sample.jpg) /transparency (http://www.tinaja.com/plugins/Transparency.api) /threerects (http://www.tinaja.com/plugins/threerects.pdf) /watermark (http://www.tinaja.com/plugins/Watermark.api) /verifyurls (http://www.tinaja.com/plugins/VerifyURLS.api) /flate (http://www.tinaja.com/glib/flatvue.pdf) /pstrans (http://www.tinaja.com/glib/pstrans.pdf) /advt01 (http://www.tinaja.com/advt01.asp) /amlink01 (http://www.tinaja.com/amlink01.asp) /ng1 (news:///comp.text.pdf) /ng2 (news:///comp.lang.postscript) /msc++ (http://msdn.microsoft.com/visualc/productinfo/default.asp) /degub (http://www.tinaja.com/glib/degub.pdf) /ghostscript (http://www.artifex.com/pressreleases/GS70.htm) /demox.psl (http://www.tinaja.com/glib/g9demox.psl) /demox.pdf (http://www.tinaja.com/glib/g9demox.pdf) /demo.pdf (http://www.tinaja.com/glib/g9demo.pdf) /flatvue (http://www.tinaja.com/glib/flatvue.psl) /pdfrefman (http://partners.adobe.com/asn/developer/acrosdk/docs.html) /psrefman (http://partners.adobe.com/asn/developer/technotes/postscript.html) /pdfmrm (http://partners.adobe.com/asn/developer/acrosdk/docs.html) /tipdf (http://partners.adobe.com/asn/developer/acrosdk/docs.html) /asdk (http://partners.adobe.com/asn/developer/acrosdk) /mtcr (http://support.adobe.com/devsup/devsup.nsf/docs/51864.htm) /flatvue1 (http://www.tinaja.com/psutils/flatvue1.psl) /acrob01 (http://www.tinaja.com/acrob01.asp) /post01 (http://www.tinaja.com/post01.asp) /info01 (http://www.tinaja.com/info01.asp) /gurgrm01 (http://www.tinaja.com/gurgrm01.asp) { /tilley (http://www.tilleyfoundation.com) /mnglobal (http://www.mnglobal.com/energy/pg2.htm) /keely (http://www.keelynet.com) /evolve (http://www.evolvedtechnology.com) /hack64 (http://www.tinaja.com/glib/hack64.pdf) /hackar3 (http://www.tinaja.com/glib/hackar3.pdf) /resbn58 (http://www.tinaja.com/glib/resbn58.pdf) /bppt (http://www.batterypoweronline.com) /muse112 (http://www.tinaja.com/glib/muse112.pdf) /muse113 (http://www.tinaja.com/glib/muse113.pdf) /energfun (http://www.tinaja.com/glib/energfun.pdf) /bashpseu (http://www.tinaja.com/glib/bashpseu.pdf) /adobe (http://www.adobe.com) /netscape (http://www.netscape.com) /gallypsl (http://www.tinaja.com/galley1.psl) /gallypdf (http://www.tinaja.com/galley1.pdf) /atn5150 (http://partners.adobe.com/asn/developer/acrosdk/docs/createpdfapi/pdfmarkReference.pdf) /nutour (http://www.tinaja.com/bargains/nutour02.pdf) /nutoursource (http://www.tinaja.com/bargains/nutour02.psl) /bwhistle (http://www.tinaja.com/glib/bwhistle.pdf) /gonzo1 (http://www.tinaja.com/post01.asp#gonzo) /barg01 (http://www.tinaja.com/barg01.asp) /weblib01 (http://www.tinaja.com/weblib01.asp) /gurgrm01 (http://www.tinaja.com/gurgrm01.asp) /z1 (http://www.tinaja.com/bargains/thumb/albradz2.jpg) /z2 (http://www.tinaja.com/bargains/sbtesteq.asp) /z3 (http://www.tinaja.com/images/bargs/albrad02.jpg) /z4 (http://www.tinaja.com/bargains/thumb/tutenaz2.jpg) /z5 (http://www.tinaja.com/bargains/sbphone.asp) /z6 (http://www.tinaja.com/images/bargs/tutena02.jpg) /sourceme (http://www.tinaja.com/glib/gallery.psl) /sourceme2 (http://www.tinaja.com/glib/autourl.psl) } pop >> {mark exch /eurl cvx ] cvx def} forall %%%%%%%%%%%%%%%% New colorizer patches %%%%%%%%%%%%%%%%%% /boxgrays 0.899 def /grayshade boxgrays def /mastergray boxgrays def /staytint {0.33 setgray} def /staytint1 {0.25 setgray} def /showadgrays true def /red {0 settint} def /Zmacro {staytint /ypos ypos 2 add def 72 300 div setlinewidth xpos ypos moveto txtwide 0 rlineto stroke /ypos ypos -2 add def tintoff} def % hair rule /amacro {(zy0) stringmacro /ypos ypos ypara add def 0.33 setgray } def % start drop cap /bmacro {(iFy1) stringmacro /ypos ypos ypara add def black} def % finish drop cap % Gonzo character colorizer /blueon {mark /blue cvx 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /blueoff {mark /beige cvx 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton {mark 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1 {mark 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1b {mark beige cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1a {mark /aqua cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1p {mark /burple cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1r {mark /red cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1a {mark /aqua cvx % try for aqua after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1b {mark /beige cvx % try for beige after url??? 0.25 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tintoff {mark 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def %%%%%%%%%%%%%% COMPACT VERSION OF COLORIZER II %%%%%%%%%%%%%%%%%%%%%% /settint {dup /currenttint exch store 5.999 mul dup floor cvi /&cbar exch store dup floor sub /&cwt exch store [ {/setgray [ /dup cvx 0.3 &cwt 0.59 mul add /ge cvx [1 /exch cvx &cwt 0.59 mul 0.30 add /sub cvx 1 &cwt sub 0.59 mul 0.11 add /div cvx /dup cvx 1 &cwt sub /mul cvx &cwt /add cvx /exch cvx ] cvx [ &cwt 0.59 mul 0.3 add /div cvx /dup cvx &cwt /mul cvx 0] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.59 1 &cwt sub 0.3 mul add /ge cvx [1 &cwt sub 0.3 mul 0.59 add /sub cvx &cwt 0.3 mul 0.11 add /div cvx /dup cvx &cwt /mul cvx 1 &cwt sub /add cvx /exch cvx 1 /exch cvx] cvx [1 &cwt sub 0.3 mul 0.59 add /div cvx /dup cvx 1 &cwt sub /mul cvx /exch cvx 0] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.59 &cwt 0.11 mul add /ge cvx [&cwt 0.11 mul 0.59 add /sub cvx 1 &cwt sub 0.11 mul 0.30 add /div cvx /dup cvx 1 &cwt sub /mul cvx &cwt /add cvx 1 /exch cvx] cvx [0 /exch cvx &cwt 0.11 mul 0.59 add /div cvx /dup cvx &cwt /mul cvx] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.59 1 &cwt sub mul 0.11 add /ge cvx [1 &cwt sub 0.59 mul 0.11 add /sub cvx &cwt 0.59 mul 0.30 add /div cvx /dup cvx &cwt /mul cvx 1 &cwt sub /add cvx 1] cvx [0 /exch cvx 1 &cwt sub 0.59 mul 0.11 add /div cvx /dup cvx 1 &cwt sub /mul cvx /exch cvx] cvx /ifelse cvx /setrgbcolor cvx] cvx /def cvx} {/setgray [/dup cvx 0.11 &cwt 0.30 mul add /ge cvx[&cwt 0.30 mul 0.11 add /sub cvx 1 &cwt sub 0.30 mul 0.59 add /div cvx /dup cvx 1 &cwt sub /mul cvx &cwt /add cvx /exch cvx 1] cvx [ &cwt 0.30 mul 0.11 add /div cvx /dup cvx &cwt /mul cvx /exch cvx 0 /exch cvx ] cvx /ifelse cvx /setrgbcolor cvx ] cvx /def cvx} {/setgray [ /dup cvx 0.30 1 &cwt sub 0.11 mul add /ge cvx[ 1 /exch cvx 1 &cwt sub 0.11 mul 0.30 add /sub cvx &cwt 0.11 mul 0.59 add /div cvx /dup cvx &cwt /mul cvx 1 &cwt sub /add cvx ] cvx [ 1 &cwt sub 0.11 mul 0.30 add /div cvx /dup cvx 1 &cwt sub /mul cvx 0 /exch cvx] cvx /ifelse cvx /setrgbcolor cvx ] cvx /def cvx} ] &cbar get exec exec} bind def /beige {0.10 settint} def % examples of convenience operators /aqua {0.52 settint} def /blue {0.67 settint} def /lime {0.44 settint} def /burple {0.75 settint} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def % guru % activate gonzo utilities 50 50 10 setgrid % create grid % 56 61 showgrid /setpagefonts { /cstretch 0.015 def /sstretch 0.015 def /font0 /StoneSans-Bold 1.6 gonzofont /font1 /StoneSans 0.95 gonzofont /font2 /StoneSans [0.95 0 0.25 0.95 0 0 ] gonzofont /font4 /StoneSans 0.85 gonzofont /font3 /StoneSans-Bold 0.85 gonzofont /font6 /StoneSans-Bold 0.85 gonzofont /font7 /StoneSans-Bold 1.05 gonzofont % subheaders /font8 /StoneSans-Bold [0.65 0 0 0.65 0 0.4] gonzofont /txtwide 36 store /yinc 1.2 store /kern 0.1 store /pm 1.5 store aqua 0.33 setgray font1 black /amacro { mark /aqua cvx 0.33 /setgray cvx ] cvx printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch } def /bmacro { mark /black cvx ] cvx printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch } def /shiftin {xpos /xposhold exch store /xpos xpos 3 add store} def /shiftout {/xpos xposhold store} def /texttop 51 store /textleft 3 store /cmacro {aqua 0.25 setgray (znhL7) stringmacro /xpos xpos 1.7 sub store /ypos ypos .1 sub def } def % left title /dmacro {black (pL1hz) stringmacro /xpos xpos 1.7 add store /ypos ypos .1 add def} def % normal text after centered title /fmacro % try and fake | {mark /gsave cvx /currentpoint cvx /moveto cvx 0.1 /setlinewidth cvx 0 0.65 /rlineto cvx /stroke cvx /grestore cvx ] cvx printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def } def setpagefonts % -2 50.5 (optional header here \274) cl %% Set document opening conventions. Note DOCVIEW limited. [/CropBox [0 0 520 620] % set the wierd size /PAGES pdfmark [ {Catalog} << /ViewerPreferences << /FitWindow true /CenterWindow true >> /PageLayout /OneColumn % continous /Pagemode /UseNone % no thumbs /View [/XYZ null null 1 ] % force 100% >> /PUT pdfmark %%%%%%%%%%%%%%%%% START DEMO ART (not in use) %%%%%%%%%%%%%%%% %%% Hand patching Info: % next available variable is /GS3 % transparency gstate is object 2 % contents stream is object 18 gets q /GS3 gs (xstuff) Q % be sure to q Q bracket to localize % resources stream is object 19 gets /GS3 2 0 R /transoverlay { % make a new graphics state [ /_objdef {newgsstate} /type /dict /OBJ pdfmark % fill the new overlay graphics state - See PDF manual for details [ {newgsstate} << /Type /ExtGState /ca 0.5 % fill transparency is 0.5 /CA 0.5 % stroke transparency is 0.5 /BM /Normal /AIS false /OP false /OPM 1 /op true >> /PUT pdfmark % start a Begin Picture graphics overlay subroutine... [ /BBox [0 0 1000 1000 ] /_objdef {overlaypix} /BP pdfmark % fill the Begin Picture graphics overlay Xobject subroutine... 0 0.5 1 setrgbcolor % on the aqua side of blue 4 4 6 6 rectfill % complete the Begin Picture graphics overlay Xobject... [ /EP pdfmark } def % Write a two squares program... /twosquares { gsave translate 1 0.5 0 setrgbcolor % red side of orange 2 2 6 6 rectfill % do background opaque box [ {overlaypix} /SP pdfmark % show foreground transparent box grestore} def % Distill the two squares program. Initially use a BARE Distiller Job % Options that has no compression, no embedded fonts, and little else save /snap1 exch store %%% transoverlay % create new objects %%% 14 17.5 twosquares snap1 restore %%%%%%%%%%%% END DEMO %%%%%%% %%%%%%%%%%%% PHOTO INSERTS %%%%%%%%%% % When photos are needed, they are inserted here. Comment out otherwise. %%%%%%%%% photo links %%%%%%%%% /pixfilename1 (C:\\windows\\desktop\\aaraw_pix\\flashfix.jpg) def /figure1 {12.5 37 200 200 pixfilename1 jpegimageproc} def % image link /pixfilename3 (C:\\windows\\desktop\\aaraw_pix\\dintcjx1.jpg) def /figure3 {12.5 0 225 202 pixfilename3 jpegimageproc} def % image link /hotspot1 { 0 0 20.5 14.3 (http://www.tinaja.com/images/bargs/marcon01.jpg) setareaurl} def /hotspot3 { 12.5 0 30 15.5 (http://www.tinaja.com/images/bargs/dintcj01.jpg) setareaurl} def /photoscale 0.075 store /jpegimageproc { % hoffset voffset hres vres save /snap2 exch def /infilename exch store % grab passed pix file /vpixels exch store /hpixels exch store translate % adjust position for final figure ??? electronics begin /DeviceRGB setcolorspace % pick color model 0 0 translate % set page position hpixels vpixels scale % magnify unit square photoscale dup scale /infile infilename (r) file def % establish input read file /Data {infile /DCTDecode filter} def % define a data source << % start image dicationary /ImageType 1 % always one /Width hpixels % JPEG width in pixels /Height vpixels % JPEG height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource Data % proc to get filtered JPEG /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image operator end ypos snap2 restore /ypos exch def } def %%%%%%%%%%%%%%%%%%%%%% HOTSPOTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % manually positioned area url click.. /setareaurl { /cururlname exch store % save the url string /ury exch store /urx exch store /lly exch store /llx exch store mark % start pdfmark /Rect [ llx lly urx ury] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def %%%%%%%%%%%%% /burpwide 29.5 store /burplebox3 {save /burp1 exch store xpos ypos translate -1 .2 mt 3.5 yinc mul .4 add pd burpwide pr 3.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox2 {save /burp1 exch store xpos ypos translate -1 .2 mt 2.5 yinc mul .4 add pd burpwide pr 2.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox2.5 {save /burp1 exch store xpos ypos translate -1 .2 mt 3 yinc mul .4 add pd burpwide pr 3 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox4 {save /burp1 exch store xpos ypos translate -1 .2 mt 4.5 yinc mul .4 add pd burpwide pr 4.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox5 {save /burp1 exch store xpos ypos translate -1 .2 mt 5.5 yinc mul .4 add pd burpwide pr 5.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox6 {save /burp1 exch store xpos ypos translate -1 .2 mt 6.5 yinc mul .4 add pd burpwide pr 6.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox7.5 {save /burp1 exch store xpos ypos translate -1 .2 mt 8 yinc mul .4 add pd burpwide pr 8 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox8 {save /burp1 exch store xpos ypos translate -1 .2 mt 8.5 yinc mul .4 add pd burpwide pr 8.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox9 {save /burp1 exch store xpos ypos translate -1 .2 mt 9.5 yinc mul .4 add pd burpwide pr 9.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox15.5 {save /burp1 exch store xpos ypos translate -1 .2 mt 16 yinc mul .4 add pd burpwide pr 16 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox17 {save /burp1 exch store xpos ypos translate -1 .2 mt 17.5 yinc mul .4 add pd burpwide pr 17.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox20 {save /burp1 exch store xpos ypos translate -1 .2 mt 20.5 yinc mul .4 add pd burpwide pr 20.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox26.5 {save /burp1 exch store xpos ypos translate -1 .2 mt 27 yinc mul .4 add pd burpwide pr 27 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def /burplebox36 {save /burp1 exch store xpos ypos translate -1 .2 mt 36.5 yinc mul .4 add pd burpwide pr 36.5 yinc mul .4 add pu closepath 0.9 setgray fill burp1 restore } def %%%%%%%%%%% %%%%%%%%%%% figure two routines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % expandgamma expands and filters the gamma curve to additional data points /gammatrips 5 store % number of filter trips /expandgamma { /gamma1 gamma store gammatrips { % multiply values by 32 mark 0 1 gamma1 length 2 sub {/gpos exch store % interpolate points gamma1 gpos get dup gamma1 gpos 1 add get add 2 div } for gamma1 dup length 1 sub get ] /gamma1 exch store mark gamma1 0 get 1 1 gamma1 length 2 sub {/gpos exch store % filter to (point + slope) /2 gamma1 gpos get gamma1 gpos 1 sub get dup gamma1 gpos 1 add get exch sub 2 div add add 2 div } for gamma1 dup length 1 sub get ] /gamma1 exch store } repeat mark % change to 256 element array 0 1 254 {255 div gamma1 length 1 sub mul /ggpos exch store /glow gamma1 ggpos floor cvi get store /ghi gamma1 ggpos ceiling cvi get store /gfract ggpos dup floor sub store ghi glow sub gfract mul glow add % ( raw interpol --->) print dup == 255 mul round cvi (\n\n) print } for 255 ] /gamma1 exch store % gamma1 == } store %%%%%%%%%%%%% % plotgamma makes a gamma plot for viewing... /plotgamma { save /gammasnap exch store translate 0.7 dup scale gsave 0 0 mt 20 pu 20 pr 20 pd closepath 0.9 setgray fill grestore 20 20 showgrid line3 0.65 setgray 0 0 mt 20 u 20 r 20 d 20 l black line3 staytint1 0 0 mt 0 1 gamma1 length 1 sub {/ppos exch store ppos 20 mul gamma1 length div gamma1 ppos get 256 div 20 mul % dup == lineto } for stroke 0 1 gamma length 1 sub {/gggposn exch store gggposn gamma length 1 sub div 20 mul gamma gggposn get 20 mul mt dot } for /cstretch 0.0 store /sstretch 0.0 store /font1 /Helvetica-Bold 1.05 gonzofont font1 black 10 22.3 (gamma curve for) cc 10 21 ([ ) gamma { 10 string cvs mergestr ( ) mergestr} forall (]) mergestr cc 0 -1.5 (black) cc 10 -2 (INPUT) cc 20 -1.5 (white) cc -1.3 0 (black) cr gsave -1.5 10 translate 90 rotate 0 0 (OUTPUT) cc grestore -1.3 19.7 (white) cr gammasnap restore} store /figure2 {save /f2snap exch store /yinc 0 store /ybot -9999 store /colcheck {} store /ylimit -9999 store /gamma [0 .05 .13 .5 .87 .95 1] store expandgamma 12.5 21.5 plotgamma f2snap restore} def %%%%%%%%%%%%%%%% end figure two routines %%%%%%%%%%%%%%%%%%%%%%%%%%%% /pagenum 1 store /startnewpage { black beige 0.35 setgray 21 -2.5 (|3\320|j) pagenum 10 string cvs mergestr (|j\320) mergestr cc aqua showpage %% start next page /pagenum pagenum 1 add store 50 50 10 setgrid % create grid setpagefonts font1 textleft texttop } def /su {surl font6} store /to {tinton1 font6} store /tx {tintoff font1} store /tabs [11 15] store aqua 0.33 setgray font0 20 47.3 0.7 add 1 sub (Dodges & Burns for your Digital Camera!) cc % 20 45.3 0.7 add (Search & Replace Utility) cc black font2 textleft 43 0.3 add % this one only need |h below (|/aqua |/staytint1 |3Don Lancaster Synergetics, Box 809, Thatcher, AZ 85552 copyright c2003 as |/surl |6GuruGram|1|/gurgrm01 |/tinton1 |6#17 |/surl http://www.tinaja.com|/tinaja |/surl don@tinaja.com|/maildon (928) 428-4073 |/aqua |/black |a|0B|b|1|jack in the "slopping in the slush" bad old days of conventional darkroom photography, each phototech had their own secret methods of improving their final results. Two of the most important of these were the |/to dodging paddle|1|/tx and the |/to burning card|1|/tx . |h A dodging paddle was used to |/to hold back|/tx light by waving it over areas of the paper being exposed in the enlarger. This would |/to lighten|/tx certain selected areas. The burning card had a small hole in it, so only selected photo portions would receive |/to more|/tx light. This would |/to darken|1|/tx selected areas instead. In this manner, errors of exposure or lighting could sometimes be corrected. |h We've already seen in |/su GuruGram #15|1|/gurgrm01 on |/su Swings & Tilts|1|/swingt01 how it is possible to take any |/su BMP bitmap image|1|/expbmp and replace each pixel with interpolated nearby ones, thus correcting geometrical distortion, creating architectural perspective, or doing intentional scanner-to-offaxis-photo fitting. A unique high resolution cubic spline |/su Basis Function|1|/basis technique gets used for maximum image fidelity. |h In my new |/su Dodges & Burns|1|/dodbur01 utility, we instead modify each and every selected bitmap pixel |/to in place|/tx , following a rule or set of rules. Besides traditional dodging and burning, you can selectively alter intensity, saturation, gamma, contrast, hue, chroma, and vignetting, and even handle selective |/to transparent alpha overlays|/tx . Plus doing masking, gray conversions, waterfall backgrounds, color separations, knockouts, magic low JPEG artifact backgrounds, and gamma plots. |h We'll note in passing that, yes, you can do much of this with |/su Photoshop|1|/adobe . And even some of it with |/su ImgViewer/32|1|/imgviewer32 . But here, all of the algorithms are out front where you can directly work with them and customize them to your own needs. You also have absolute and total control. |h In general, the process is as follows: You first load the |/su Dodges & Burns|1|/dodbur01 utilities into a favorite word processor or editor. You then decide what you want to do and then create a |/to map|/tx or set of visual instructions over what portions of the image will get emphasized, shifted, or altered in what manner. ) cl startnewpage (You then assign suitable filenames, both to locally available resources and target outputs. You next pick an appropriate |/to mode|/tx for what you wish to accomplish. Followed by saving the routines under a new filename |/to as an ordinary ASCII |/to textfile|1|/tx . Finally, you send your file to |/su Acrobat Distiller|1|/adobe , and your corrected BMP image should appear in the expected file area. |h These routines use my |/su Gonzo Utilities|1|/gonzoutils and a copy needs to be made locally available. While proudly not WYSIWYG, the process is easily learned and the processing times are amazingly fast. A typical dodge and burn may take you a few seconds. There are detailed examples at the end of |/su DODBUR01.PSL|1|/dodbur01 which we will expand upon here. |h More on |/su Gonzo|1|/post01 and additional support appears on our |/su PostScript|1|/post01 , |/su Acrobat|1|/acrob01 , |/su Bitmapped Fonts|1|/aafont01 , and |/su GuruGram|1|/gurgrm01 library pages. While custom assistance can be found by way of our |/su InfoPack|1|/info01 library. |h |c How it works |d The basic dodge and burn concept is to grab a bitmap image one pixel at a time, perhaps modify that pixel in a |/to mode|/tx selectable way, and then rewrite the changed image to a new file. A companion |/to map|/tx array often gets used to determine which pixels will get affected to what strength. To both simplify and speed things up, the bitmaps are read and written one horizontal line at a time. Additional info on the |/su bitmap|1|/expbmp format appears in |/su GuruGram #14|1|/gurgrm01 . |h At present, there are about a dozen different modes available. An appropriate mode gets selected for the task at hand by predefining it as |/to /dodgeburn|/tx before activating the main |/to dodge&burn|/tx code loop. Some of the modes now include\274 |6|/shiftin |/burplebox15.5 |/to |6dbmap|1|/tx |tMake an |/to image of the map|/tx array. |tCertain maps may require scaling. |h |/to |6dbluminance|1|/tx |tLighten or darken each pixel's |t|/to luminance|/tx per the current map. |tDoes a classic dodge and/or burn. |h |/to |6dbsaturation|1|/tx |tIncrease or decrease each pixel's |t|/to color saturation|/tx per the current map. |h |/to |6dbgamma|1|/tx |tIncrease or decrease each pixel's |t|/to gamma value|/tx per the current map. |tRaises or lowers contrast or enhances |textreme whites or blacks. |h |/to |6dbhue|1|/tx |tShifts the hue and |/to changes colors|/tx |tbut preserving saturation. |1|/shiftout |/aqua |/black |h |t more\274 )cl startnewpage (|6|/shiftin |/burplebox17 |/to |6dbvignette|1|/tx |tCreates |/to Vignette edge effects|/tx by |taltering edge luminance. |h |/to |6dbgray|1|/tx |tCreates a |/to Gray Image|/tx by using NTSC |tand human eye weighted luminance. |h |/to |6dbredsep|1|/tx |tCreates a |/to red color separation|/tx by |tblackening blue and green pixels. |h |/to |6dbgreensep|1|/tx |tCreates a |/to green color separation|/tx by |tblackening red and blue pixels. |h |/to |6dbbluesep|1|/tx |tCreates a |/to blue color separation|/tx by |tblackening red and green pixels. |h |/to |6dbmask|1|/tx |tCreates a |/to black mask|/tx of all |tpixels below a certain luminance. |h |/to |6dbtransblend|1|/tx |t|/to Transparently alpha combines|/tx a |tbackground and overlay image. |1|/shiftout |/aqua |/black |c The Map |d The |/to map|/tx is an array of numbers that sets the strength of the desired effect. Its size can be anything from 2x2 on up and it need not be square. A key rule\274 |3|/shiftin |h |/staytint1 The array position is the same as the image position. |1|h|/shiftout |/aqua |/black Maps are automatically expanded and smoothed so they end up pretty much the same size as the bitmap image. An final interpolation then gives an exact fit. |h Let's look at a map example. A typical "flash problem" is that the bottom left of your picture is "too hot" while the exposure darkens towards upper right. Here's a luminance correcting mask that may fix this shading\274 |6|/shiftin |/burple |/burplebox6 |/staytint1 /burn0.5SW { % 50|j% luminance reduction /dbdata [ [ 0.750 0.825 1.000 ] [ 0.625 0.750 0.820 ] [ 0.500 0.625 0.750 ] ] store } store |1|/shiftout |/aqua |/black Note that we've told the bottom left to darken by half amplitude, to reduce the diagonal to three-quarters amplitude, but to leave the upper right at the full original luminance. |h And here is what this map looks like after lowpass filtering and expansion\274 )cl startnewpage ( Because the human eye is exceptionally sensitive to slope discontinuities, an expansion and filtering is normally done to get the map up to size. The present lowpass filter algorithm is somewhat "Gaussian like". Expansion and filtering is done by doubling the data points through averaging. |/to Each point is then replaced |/to by half its value plus half the average of the previous and post point.|/tx |h Five repeat filterings are typically done, set by a |/to /filtertrips|/tx variable. This 1024X data point multiplication eliminates anything disconcerting to the eye, but may need reduced when sharper mask edges or larger array sizes (|j>|j20x20|j) are in use. You can usually use the |/to dbmap|/tx mode to view your actual maps. |h While maps normally have data points in the 0 to 1 range, they may differ in certain modes. For instance, a hue map might be in degrees of change from -360 to +360, while a mask map might be an actual white threshold such as 254. Note that |6|/tinton1r it is usually better to darken than strengthen|/tx if you are to avoid running into any "superwhite" or "supersaturation" problems. |h|/aqua |c Gamma Curves |d By suitably tampering with the |/to transfer function|/tx of any image processing system, you can selectively raise or lower midtone contrast, enhance or reduce highlights or shadows, and do any of a number of other special effects and improvement tricks. The |/to gamma curve|/tx usually starts at black 0,0 and ends up as white 1,1. For image fidelity, you should have a straight line between. |h But, if your gamma curve is suitably "bent", all sorts of corrections are possible. Ferinstance, a 0.5,|j0.5 slope |/to above|/tx unity |/to raises|/tx your midtone contrast. A |/to less|/tx than unity slope |/to lowers|/tx midtone contrast. A "fast start" from 0,0 expands shadow detail, while a "slow start" minimizes it. Doing so near 1,1 alters highlights. |h A |/su histogram|1|/histog01 analyzer is one way to find out where all your present pixels are and how they can be improved. But most often, it will be obvious that there is a contrast, highlight, or shadow problem. The usual correction method is to create a 256 element |/su table lookup|1|/speedup2 array. )cl figure1 startnewpage (My approach here was to define a gamma array such as this contrast raiser\274 |6|/shiftin |/burple |/burplebox2 |/staytint1 |h /gamma [|j0 .05 .13 .5 .87 .95 1|j] store |1|/shiftout |/aqua |/black |h Any number of |/to equally spaced|/tx points can be used. This is expanded and 1D filtered the same way we did the 2D map expansion to yield a 256 entry table. The actual correction then consists of a fast and simple table lookup adjustment for red, blue, and green. |h If you do a |/to /plotgammaflag true def|/tx you can view the actual gamma curve as .PDF output\274 |c Some Examples |d Let's briefly look at some of the sneaky things you can do with |/su Dodges & Burns|1|/dodbur01 , along with their underlying algorithms. Largely following the end demos\274 |h |/to |6Show the Mode Map \320 |/tx Uses mode |/to dbmap|1|/tx and simply replaces each image pixel with a gray pixel equal to the map value using 0 = black and 1 = white. Note that some special purpose maps will need scaled before using this feature. Handy to make sure the map is doing what it is supposed to and checking its alignment on the image to be corrected. |h |/to |6Adjust the Luminance \320 |/tx Uses mode |/to dbluminance|/tx and multiplies each red, blue, and green pixel value by the map factor. Thus doing a classic dodge and burn. A map value of 1.0 leaves the pixel color the same. A map value of 0 replaces it with black. Map values above 1.0 will brighten the pixel, but this can lead to oversaturation or overwhite conditions. These are clipped automatically. |h Setting |/to /holdwhite|/tx to true will prevent any changes to true white (255) pixels. This is handy for paint "tow-over" transparency or later use of |/su MAGFILL1.PSL|1|/magfill1 . )cl figure2 startnewpage (Similarly, booleans |/to makeredchanges|/tx , |/to makegreenchanges|/tx , and |/to makebluechanges|/tx let you selectively apply corrections to individual red, blue, or green pixel values. |h |/to |6Change Perceived Saturation \320 |/tx Uses mode |/to dbsaturation|1|/tx to alter the "brilliance" or "depth" of each color. The perceived saturation of each color follows this NTSC and eye response formula\274 |6|/shiftin |/burplebox2 |/staytint1 |h gray equivalent = 0.59 green + 0.30 red + 0.11 blue |1|/shiftout |/aqua |/black |h To change perceived saturation, the gray equivalent of the pixel triad is first calculated using the above formula. The current saturations are found as the |/to differences|/tx of |/to red|j-|jgray|/tx , |/to green|j-|jgray|/tx , and |/to blue|j-|jgray|/tx . These differences then get scaled by the map value to increase or decrease the color depths. |h As before, booleans |/to makeredchanges|/tx |/to makegreenchanges|/tx and |/to makebluechanges|/tx let you selectively apply corrections to individual red, blue, or green pixel values. Note that this is a different definition of saturation than in HSB. |h |/to |6Change to Gray Image \320 |/tx Uses mode |/to dbgray|1|/tx to change a color image into an equivalently perceived black and white one. Calculates the gray equivalent of the pixel triad as above and then identically substitutes its value for all three color pixels. Also useful to help determine whether a subtle problem is one needing luminance or saturation correction. |h |/to |6Localized Blob Burn \320 |/tx Uses mode |/to dbluminance|1|/tx to change only a small portion of the image. The only difference is in the map where a tight spot is created rather than a gradual gradient. As before, selective red, blue, or green corrections can be individually made. Handy to correct a smaller defect in an image. |h |/to |6Luminance Vignette \320 |/tx Uses mode |/to dbluminance|1|/tx to do an edge fadeout or a self framing of an image such as this example\274 )cl figure3 hotspot3 startnewpage (Actually, vignetting started out as |/to defects|/tx in plate coating and off-axis lens aberrations. While quiet useful as special effects, they easily can become way too garish or cutsey-poo. And thus should be used with caution. A vignette is just a |/to dbluminance|/tx burn using a special map that either emphasizes or fades the borders. Here is a typical "self-framing" mask example\274 |6|/shiftin |/burple |/burplebox20 |/staytint1 /dbdata [ /vv 0.55 store /ww 0.7 store [ vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv ] [ vv ww 1 1 1 1 1 1 1 1 1 1 1 1 ww vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv 1 1 1 1 1 1 1 1 1 1 1 1 1 1 vv ] [ vv ww 1 1 1 1 1 1 1 1 1 1 1 1 ww vv ] [ vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv vv ] ] store } store |1|/shiftout |/aqua |/black |h A "fade to white" vignette is a tad trickier. But can easily be done with use of our upcoming |/to variable transparency|/tx dodge & burn mode. |h |/to |6Adjust the Hue \320 |/tx Uses mode |/to dbhue|1|/tx to rotate all the colors uniformly around the color wheel. Small adjustments make an image "warmer" or "cooler". Major ones handle mind-boggling special effects. |h HSB is simply a remapping of RGB that gives us direct control of hue, the actual saturation, and brightness. In the HSB color model, the |/to weakest|/tx RGB value gets replaced by gray and becomes the |/to brightness|/tx . The |/to difference|/tx between your |/to strongest|/tx and |/to weakest|/tx of RGB becomes the |/to saturation|/tx . And the |/to hue|/tx is determined by the |/to ratio|/tx of the |/to strongest|/tx and |/to next strongest|/tx RGB elements. |h It turns out there are |/to six|/tx different |/to hexants|/tx in the 0 to 360 degree HSB color wheel. Covering red through yellow, yellow through green, green through aqua, aqua through blue, blue through violet, and finally violet back to red. Each one has to be separately dealt with\274 )cl startnewpage (|6|/shiftin |/burplebox26.5 |/to |60 to 60 degrees|1|/tx |tSaturation is set by (R-B). |tHue is 0 + 60*(G-B)/(R-B). |tBrightness is set by blue. |tColors range red through yellow. |h |/to |660 to 120 degrees|1|/tx |tSaturation is set by (G-B). |tHue is 60 + 60*(1-((R-B)/(G-B))) |tBrightness is set by blue. |tColors range yellow through green. |h |/to |6120 to 180 degrees|1|/tx |tSaturation is set by (G-R). |tHue is 120 + 60*(B-R)/(G-R). |tBrightness is set by red. |tColors range green through aqua. |h |/to |6180 to 240 degrees|1|/tx |tSaturation is set by (B-R). |tHue is 180 + 60*(1-((G-R)/(B-R))). |tBrightness is set by red. |tColors range aqua through blue. |h |/to |6240 to 300 degrees|1|/tx |tSaturation is set by (B-G). |tHue is 240 + 60*(R-G)/(B-G). |tBrightness is set by green. |tColor range blue through violet. |h |/to |6300 to 360 degrees|1|/tx |tSaturation is set by (R-G). |tHue is 300 + 60*(1-((B-G)/(R-G))). |tBrightness is set by green. |tColor range violet through red. |1|/shiftout |/aqua |/black |h Hue image pixel correction gets done by converting the present RGB pixel triad into HSB values, selecting the correct hexant, adding or subtracting your hue correction from the map, reselecting a correct hexant, converting back to RGB, and then storing to the new image. While avoiding any divide-by-zeros on hue calculations. Allowable map values range from -360 to +360 degrees. |h Note that the "saturation" definition in the HSB model does |/to not|/tx allow for human color perception differences. If you your shift hue too far, certain colors may appear much brighter or darker than normal. Moving any of our |/to dbsaturation|/tx perception techniques over into HSB space gets tricky as it could cause both missed colors and supersaturation problems. |/to |6Make a Chroma Waterfall Background \320 |/tx Uses mode |/to dbchroma|1|/tx with significant hue shifts to create rippling colors. Normally used on a background only that starts with its central color. Actual subjects are then pasted in later. )cl startnewpage (|/to |6Adjust Gamma or Contrast \320|/tx Uses mode |/to dbgamma|1|/tx and the |/to gamma array|/tx we looked at above to table lookup correct each pixel color value. The 256 entry table is created ahead of time for speedup. Once again, steep midrange slopes increase contrast, steep blacks expand shadows, steep white expand highlights. |h |/to |6Make a Black Mask \320|/tx Uses mode |/to dbmask|1|/tx to create an opaque knockout of the subject. A pixel-by-pixel comparison is made with a threshold value (often 254) and black (0) gets substituted for lower values and white (255) for higher. Also useful to create litho and other extreme contrast effects. |h |/to |6Do Color Separations \320|/tx Uses |/to dbredsep|/tx , |/to dbgreensep|/tx , or |/to dbbluesep|/tx modes to create red-only, green-only, or blue-only images. Each of the two unwanted colors is simply replaced by black 0. While retaining a 24-bit RGB color image. Besides traditional separations, these routines can sometimes extract extra detail for near-white or near-black portions of an image. For one particular color (the darkest of the lights and vice versa) may often contain more recoverable contrast and more luminance detail. |h |/to Transparent Alpha Overlay \320|/tx Uses the |/to dbtransblend|/tx mode to selectively combine two images into one. As an upgrade and improvement over our older |/su BLENDER.PSL|1|/blender found in our |/su Bitmapped Fonts|1|/aafont01 library. Uses a pair of |/to background|/tx and an |/to overlay|/tx image files. If the map is 0, the background pixels are used. If the map is 1, the overlay pixels are used. Intermediate map values create a progressively transparent overlay. The algorithm used for each R, G, or B pixel component is\274 |6|/shiftin |/burplebox2 |/staytint1 |h new pixel value = background + map|j*|j(|joverlay|j-|jbackground|j) |1|/shiftout |/aqua |/black |h At present, both input images |/to must|/tx be both the same size and have the same horizontal and vertical resolution. If needed, the usual cropping or scaling can be used to make this happen ahead of time. The output combined image is in itself opaque and can be used like any other normal .BMP file. |h As written, the |/to dbtransblend|/tx code does a classic alpha overlay. It can easily be converted to any of the two dozen or so alpha mask/replace options offered by |/su Acrobat 5|1|/adobe . Plus dozens more. As can various custom true chroma or luminance keys. As can combining two different sized images. Such code extensions await your funding as a |/su Synergetics Partner|1|/info01 or |/su Banner Advertiser|1|/advt01 . |c For More Help |d There are several support utilities on my website that can enhance your use of the |/su Doge & Burn|1|/dodbur01 and the |/su Swings & Tilts|1|/swingt01 packages. These include |/su NOWHIT01.PSL|1|/nowhit01 that eliminates any true white pixels to prevent "punchthru" on a white knockouts, our |/su MGFILL1.PSL|1|/magfill1 magic backgrounder to get rid of JPEG edge artifacts, |/su HISTOG01.PSL|1 |/histog01 histogram generator, and the |/su BMPRPT01.PSL|1|/bmprpt01 .BMP image analyzer. ) cl startnewpage (Additional background along with related utilities and tutorials appears on our |/su GuruGram|1|/gurgrm01 , |/su PostScript|1|/post01 , |/su Acrobat|1|/acrob01 , and |/su Fonts & Bitmaps|1|/aafont01 library pages. |h Consulting assistance on any and all of these and related topics can be found at |/surl |6http://www.tinaja.com/info01.asp|1|/info01 . As can our image improvement services. |h Additional |/surl |6GuruGrams|1|/gurgrm01 await your ongoing support as a |/surl |6Synergetics Partner|1|/advt01 . ) cl startnewpage %%%%%%%%%%%%%%%%%%%% % EOF