Simulating forest pictures by impact printers

Embed Size (px)

Citation preview

  • 8/8/2019 Simulating forest pictures by impact printers

    1/11

    PACIFIC SOUTHWEST Forest and Range F O R E S T S E R V I C EU . S . D E P A R T M E N T OF A G R I C U L T U R EP . O . B O X 245, B E R K E L E Y , C A L I F O R N I A 94701

    USDA FOREST SERVICEGENERAL TECHNICALR E P O R T P S W - 25 I 1978

    S I M U L A T I N G F O R E S T P I C T U R E SB Y I M P A C T P R I N T E R S

    E l l i o t L. A m i d o n E. J o y c e D y e

    In the applications of computers to forestry problems, theanswers are usually shown in the form of text or tables. If agraphic presentation in hard copy form.is needed, a problemarises if only a printer is available. This is particularly true at fieldlocations. The occasional need for graphic output simply does notjustify the maintenance of specialized equipment, such as incre-mental line plotters.One solution to the hardware problem is to simulate picturesby producing shades of gray with the available printer. This solu-tion is widely used to display remote sensing data. The problembecomes one of selecting the symbols to produce gray levels,from many possibilities. The approach is desirable for a quicklook at large volumes of data. Pictorial quality is severely limited,however, since the space between symbols makes streaks in thedensity patterns.

    Another alternative is to acquire a terminal that has both textand graphic capabilities. High-speed ink jet and electrostaticdevices with this dual capability require substantial investments.They may be feasible at computer centers, but not field offices.Acompromise is a mechanical printer/plotter that resembles a type-writer and costs about four times as much. Although slow, in plotmode it offers fine character positioning which allows removal ofspace between symbols, giving a smoother gradation of gray scalesthan a line printer can offer.

    This report suggests procedures to generate images with eithera line printer or a printer/plotter. It describes applications andoffers examples based on the use of elevation data available forthe contiguous United States. Methods are emphasized becausecharacter fonts are not standard, and some experimentation bythe user should be expected.

    Amidon, Elliot L., and E. Joyce Dye.1978. Simulating forest pictures by impa ct printers. Gen. Tech . Rep.PSW-25, 11p., illus. Pacific Southwest Forest and Range Exp. Stn.,Forest Serv., U.S. Dep. Agric., Berkeley, Calif.Two mechanical devices that are mainly used to print com puter ou tputin text form can simulate pictures of terrain and forests. The line printer,which is available for batch processing at many computer installations, canapproximate halftones by using overstruck characters to produce succes-sively larger "dots." Th e printer/plotte r, which is normally used as aninteractive terminal, permits fine adjustment of the space between char-acters in the plot mod e. This contro l over blank space improves tonal

    appearance and permits solid black. The two types of printers have comple-mentary uses. The line printer is best for high volumes of data, while theslower printerlplotter offers a greater range of densities.Oxford: 582- U681.3Retrieval Terms: mapping systems; computer simulation; pattern recogni-tion ; impact p rinters; grey scale.

  • 8/8/2019 Simulating forest pictures by impact printers

    2/11

  • 8/8/2019 Simulating forest pictures by impact printers

    3/11

    gray levels will raise contrast while increasing the like-lihood of creating spurious plateaus or contours. Asubset of 8 symbols ending with the penultimate levelof the 16 will result in a maximum of 6 overstrikes(fig. 2). In addition t o the advantage of reduced printtime, a subset of e ight symbo ls will be easier to formwith diverse character fonts.Elevation data for the Pyramid Peak quadranglewere assigned 1 6 gray level "dots," listed and reduced6.6-fold (fig. 7). Another illustration produced usingeight gray levels and the same reduction shows thechange in contrast (fig. 8). Print times were essen-tially the same at 2 minutes.Halftone dots are unsuitable for those applica-tions, such as statistical output from computer map-ping systems, in which the code must be distinguish-able in a map legend as well as provide a separableshade of gray. We constructed tw o sets of eight codeswhich seem to us to meet the dual requirements. Oneset may prove more suitable than the other dependingon the particular font available (figs. 3, 4). The twoseem to give a greater range than a previously pub-lished set (Stucki 1969). Stucki's codes, like our twosets, uses a maximum of four overstrikes (fig. 5).Allthree sets were printed by using Pyramid Peakquadrangle data and reducing 6.6-fold (figs. 9-11).The subtle differences in appearance change withviewing distance. A spacing of six lines per inch wasused. Ex periments with eight lines per inch, an optio nno t always available, showed no obvious gain in tonaleffect.

    PICTURE SIMULATIONWITH PRINTER/PLOTTER

    Both a line printer and a printer/plotter canmechanically produce text in an identical format of10 characters per inch across a line and 6 or 8 linesper inch. Typically a printer/plotter is used as a re-mote terminal and prints characters individually atabo ut 30 per second. The plotting capability is due tofine bidirectional increments. A solid, curved line canbe produced, for example, by producing a string ofoverlapping periods.Fine positional control enables the printerlplotterto remove the blank space between characters. Thiscapability gives it three advantages over the lineprinter. First, the dark end of the gray scale is ex-tended by diminishing or exactly rem oving the blankareas between symbols. Second, a greater diversity ofcodes is obtainable with a given number of over-

    strikes. Finally, flexibility is gained for computermapping systems using a fixed grid. Both input andou tpu t grid cells may be square, there by avoiding in-terpolation or distortion. Discrete-scale changes arealso possible, with the exact multiple uniquely deter-mined by th e o utp ut device selected.For example, o ur Diablol daisy-wheel printer/plotter has an incremental movement resolution of1148th inch between lines and 1160th inch betweencharacters. With four line feeds and five horizontalspaces, a 1112-inch square grid is attainable . Theelevation data collected at 200-foot contour intervalswere digitized from maps with a representative frac-tion of 1 to 250,000 at a m ap distance of 0.01 in. or2 08 .3 fe et on t he g r ~ u n d . ~hen these data are con-verted to gray level codes and printed at a 1112-inchresolution, the scale of the shaded map is 1 to 30,000or close to 2 inches per mile, which is a com mo n scaleused in forestry (California State Cooperative Soil-Vegetation Survey 1958).The printer/plotter offers so many combinationsof chara cter symbols, positions, and spacings tha t gridcell size must be determined before selection begins.At a 1112-inch resolution, there are 20 (4 X 5) printpositions. A period could be printed at any one of thematrix positions, giving a very general capability offorming symbols. This choice is impractical becauseof time consumed and physical wear on the period.Instead, the darker areas can be formed more rapidlywith larger symbols.We decid ed u pon 1 0 gray levels fo r relief repre-sentation. These levels can be illustrated in a legend

    (fig. 6). The northeast quarter of the Pyramid Peakquadrangle was printed a nd reduced 3.3-fold for com -parison with the line printer images. Print time was 2hours, 10 minutes or 3 1 sq. in. per hour (fig. 12). Thecost in dollar terms is more elusive because the hard-ware configuration we used is not rented. The Pyra-mid Peak illustration cost about $7 to $8, assuming a5-year depreciation period, maintenance, and one-shift use.Some experimentation may be necessary to repro-duce the appearance of th e illustrations in this report.

    'Trade names and commercial enterprises or products arementioned solely for information. No endorsement by theU.S. Department of Agriculture is implied.Elevation data are available from th e National CartographicInformation Center, U.S. Geological Survey, 507 NationalCenter, Reston, Virginia 22092.

  • 8/8/2019 Simulating forest pictures by impact printers

    4/11

    ......... , , , s t , , , s v + + + + + + + + + + t t t t i t t t t t l l * S * i * * * l I W l K K I I 1 ~ 1 ~ 1 1 1 1 ~ 1 # * * * * * I #.......... ,,,,,,,,,. *****+**** t t t t t t t t t t * l W l * * l * * * l N W l I l l * * * 1*11111111 *I*******......... . , , , . , ,#,, ++**++*+.* t t t t t t t t t t Illlllill* 1 1 1 1 1 1 1 # 1 l IlIIIll*ll ****lI***.......... ,,,,,.,.,, + + + + + * + * * + 4 4 4 t t t t t i t * * l * * * * l # * 1111111*11 W * * I W * l * *I*******.......... ,,,,,,,,,, + + + + + + + + + + t t i 4 i 4 t t t t R * S * ~ ? R i l S l ~ I l l l 1 l W W 1 < 1 1 1 K l ~ **********.......... ,,,,,,,,,, + + * + * * + * * * t t t t i t t t t t **s******* *111*11*11 * * * a * * * * * *l l l f w l l I lA Z ~ f ~ i * l f H f t f V ' - ' 2 1 ? V M X X A V - X A V - A V X X * - X X * *

    Figure 1-A set of 1 6 symbols for a hal f tone d isp lay , n ot inc luding b lank .+ + n X X + X X * * A V + - X X A V - A Z V 1 2 T.......... ++++*+++** * t l * f f * * * f I*ll*ll*l*.......... +++++*.+*+ 1 e 1 * * * * f * * f * * * f D * * 1 1 1 1 1 1 1 I I I I I * I 1111111ll1~ I I W W I I N ~.......... +*++*++*+* i f . f * * * l , * * I I * KII1I1111 1111111111*+++*+++*+ * * f * i * l * % ?......... * * * * * * * * * l l * l N W * * * * W * 1111111111 1111111111* V l * W R l * X R++*+++*+*+ Il**l***l*.......... * * * f * t * l * f 1 1 ~ * * * 1 * IIIIIIIIII 1111111111l l I l I * l * * S* * + + + + * + * * n * * # n * x * n s.......... * * * * * * * * * ? * 1 * 1 * 1 I l l l l l 1111111111mi i io* *l**l****I**w**wwe* 1111111111 1111111111

    Figure 2-Eight hal f to ne symbols f r om th e above set o f 1 6 (every odd-numbered symbol ) .

    + 1 H I B X M I X A ZV I.......... + + + + + + + + + + t t t t t t t t t t @ @ B Q + + + * . + + + * + i n i n r 8 1 i i i 8 mmt t t t t t t t t t 1111111111......... m m e m m m m m. + + + * + * + .+ n 1 1 m i i m 8 u n i n 1111111111t + t t t t t t t t 1 1 1 1 1 1 1 H W..........B LA N K 1 R @ + + * + + + + + + + 111111111118111111 1 r 1 1 mi t t t t t t t t t m m ~ a ~ . s # m c f l I I I I N B I W W 11111**111 1111111111......... * + + * + + + + + , t t t t t t t t t t 1111111111......... f i l f l B.......... *+*+.*+*.* U I M E L l 8 # 8 8 0 iiimrt t t t t t t t t t 1l11111111m r n m ~ @ c ~ u @ m ~ ~ n m i i n n 1 1 n i i l m i m 1111111111Figure 3-This set o f eight gray tone symbols can be dist inguished in a legend accompan ying an i l lustrat ion.

    . + 1 X I x n U M I M V( B L A N K )

    ,.,,,,,,,. .......... t t i t t i i i i t I I I I I I I I I I N WW II WK WW XK 1 1 1 1 1 1 1 @,,,,,,,,,, .......... f t i t t i i t i t n w w m w w w w w w m 1 1 1 1 1 m 1 1111111111I I I I I 1 I I I,,,,,,,,,, . s . .e .e . *m t t t i i f i f f i I I I I I I I I I I 1111111111wwwwmwwww 1111l11111s,,,,,,,,,

    iiimr.......as. i t t f t i f f i i I I I I I I I I I I w11wwwwwwww # 1 1 1 1 * 1 1 iiimr.,,,,,,.,. .......... t t t i t i i i t i I I I I I I I I I I www 11 ww 11 ww w 1 1 1 1 1,,,,,,,,,. .......... t i t i f f t i i t I I I I I I I I I I wwwwwwww ww m i m i a m m i m r n nn m r n i i i

    Figu re 4-This set o f eight separable gray codes may be more suitable w ith some l ine -pr inte r character fonts.+ X X X X = O X * U MWU

    Figu re 5-Stucki's set of eight gray level codes uses four overstr ikes (Stuck ! 1969 ).. . . . ., , . , z;:;( B L A N K ) :; ; ; ; :;:>;:;:; < fiM.................... .,,z ^^..............

    Figure 6-A pr inter /p lot ter set of 10gray tones can be used in a m ap legend.

  • 8/8/2019 Simulating forest pictures by impact printers

    5/11

    Figure 7-Digital elevat ion data spanning 4000 feet F igure 8-Reducing the number o f h a l f tone "dots"give an impression of re l ie f when t ransformed in to f r o m 1 6 o 8 increases contras t.half tones.

    Figure 9-These terrain data were produ ced by the Figure 10-The same terrain i l lustrated in figure 9 ise igh t sym bo ls o f figure 3. pictured b y us ing the e ight symbols in figure 4.

    Figure 11 -The same Pyram id Peak data using Stucki 's F igure 12-A pr in ter lp lo t ter representation of re l ie fset o f e ight symbols (Stuc k i 1969 ) . 5 ca n be compared to the f igures produced by l inepr in ter .

  • 8/8/2019 Simulating forest pictures by impact printers

    6/11

    The character and overstrike patterns used to illus-trate the terrain data (figs.7-12) are shown in figures1-6: Symbols shown in Were used tothese figures: produ ce these figures:1 72 83 94 105 116 12

    In programming and operating a printer/plotter,we fo und several small ways to improve performancewhich may apply to like mechanical devices. Wefou nd the quality of an illustration to be stronglyaffected by the choice of ribbon. In most cases, filmribbon is preferable to cloth. Print time can be re-duced about 5 percent just by printing in a zig-zag(boustrophedonic) fashion. In addition to the carriagereturn time saved, print quality is improved, which isattributed to reduced vibration. Print time can be re-duced at th e cost of ad ditional programming. Thedata can be searched in advance of printing for blanklines or segments to skip over using the print suppre-ssion and ta bbing feature s available.Two versions of a sample subroutine (PATT) forreading an d processing data in to a gray-scale represen-tation are reproduced in the Appendix. These listingswill reduce development time by prospective users.Subroutine PATT can be called by a simpleFORTRAN main program. PATT reads unblockedrecords from tape but other formats and storagemedia can be used with slight program modifications.The first version was developed on a NOVA 2 witha DTC printer/plotter. The corresponding 'UNIVACversion includes horizontal expansion of the data tocompensate for line printer distortion. The eight printsymbols for the line printer are those of fig. 3, butother sets may be substituted readily.

    CONCLUSIONS

    The two types of printers are not alternatives sincethey differ greatly in output speed. They can comple-ment each other. The line printer provides a "quick-look" at, say, a large volume of remote sensing print-out. The precise positioning ability of the printer1plotter is best used for presentation where appearanceis more important. Line printers are widely availableand standardized in many respects. Some modifica-tion of charac ter sets may still be required because of

    differences in fonts, inking methods, and wear. Thegray-level symbols that we have provided should savetime in finding the best set for simulating pictures onother printers.

    LITERATURE CITEDBrassel, Ku rt

    1974. A model for automatic hil l-shading. Amer. Cartographer. 1(1):15-27.California Sta te Cooperative Soil-Vegetation Survey.1958. Soil-vegetation surveys in California. (Rev. 1969)31 p. Calif. Div. For., S acr am en to, Calif.Dickinson, G. C.197 3. Statist ical mapping and th e presentation o 4

    statistics. 19 6 p. Edward A rnold, Ltd. Lon donEngland.Federation of Ro cky Mountain States.

    1977. Composite mapping system I1 user 's manual. 205p. Reg. Tech. Pap. Econ. Dev. Adm. and Natl. SciFound., Denver, Colo.Harvard University1973. Laboratory for compu ter graphics and spatialanalysis. 30 p. Lab-Log, Camb ridge, Mass.Heller, Robert C., Tech. Coord.1975. Evaluation of ERTS-1 data for forest and range-land surveys. USDA Forest Serv. Res. Pap. PSW-112,67 p., illus. Pacific South west Fore st and Ran ge Exp.

    Stn., B erkeley, Calif.Henderson, Peter, and Steven Tanimoto.1974. Con sidera tions for efficient picture ou tpu t vialineprinter. Co mp uter Graphics and Image Process

    3:327-335.Perry, Benson, and Mortimer L. Mendelsohn.1964. Picture generation with a standard l ine printer.Comm. of the ACM. 7(5):311-313.Sharpnack, David A., and G arth Akin.1969 . An algorithm for computing slope and aspect fromelevations. Photogramm. Eng. 36(3):247-248.Sinton, D. F.197 6. The user's guide to I.M.G.R.I.D. An inform ationmanipulation system for grid cell data structures. 90 p.Dep. Landscape Architecture, Grad. School of Design,Harvard Univ., Cam bridge, Mass.Stucki, P.1969. Generation of gray tones by computer simulation

    of visual information systems. IEEE Trans. onComput . 18:642-643.Travis, Michael R., Gary H. Elsner, Wayne D. Iverson, andChristine G. Johnso n.

    197 5. VIEWIT: compu tation o f seen areas, slope, andaspect for land-use planning. USDA Forest Serv. Gen.Tech. Rep. PSW-11, 7 0 p., Ulus. Pacific Sou thw estForest and Range exp. Stn., Berkeley, Calif.

    Yoeli, P.196 5. Analytical hill-shading. Surveying and Mapping.25(4):573-579.

  • 8/8/2019 Simulating forest pictures by impact printers

    7/11

    APPENDIX

    Subroutine PATT-Version for NOVA 2/DTC 12 00 printer/plotter

    PARAMETER NOG=10 SUBROUTINE PATT(BUF,LEL,IEL,IC,JC,IR,JR,NCOL) C PRINTS SQUARE BLOCKS, 1/12 INCH X 1/12 INCH, ON THE DTC 1200. C ASSEMBLY LANGUAGE ROUTINE "OUTC FEEDS EACH CHARACTERC TO THE PRINT BUFFER. C EACH BLOCK CONTAINS 5 HORIZONTAL AND 4 VERTICAL PRINT POSITIONS. C THERE ARE 13 PATTERNS OF 5 CHARACTERS EACH. EACH BLOCK IS YADE C UP OF 4 OF THESE PATTERNS. THERE ARE 10 POSSIBLE SETS OF C PATTERNS TO PRINT BLOCKS GIVING 10 GREY SCALES. c BUF IS THE ARRAY TO RECEIVE DATA FROM INPurrFILE. C LEL IS THE LOWEST VALUE IN THE DATA. C IEL IS THE HIGHEST VALUE IN THE DATA. C 1C IS FHE BEGINNING POSITION TO BE PRINTED FROM EACH DATA Pb RECORD, JC IS THS ENDING POSITION.C IR IS THE FIRST DATA RECORD TO BE USED, JR IS THE LAST. C NCOL IS TtIE TOTAL NUMBER OF WORDS IN EACH INPUT RECORD. COMMON/A/IPAT (5,13) ISQ(4 NOG) INH80 (3) ISP (2)INTEGER LINE (1450) BUF NCOL) DATA 1PAT/40K,40K,40Kt40K,40K, 40K,40K,47Kr40K,40K,

    : 40Kf40K,54K,40K,40K, 40K,40K,40K,54Kt40K, 40K,40K,40K,73K,40Ke: 40K,56K,40K,40K,40K, 0K,72Kf40K,40K,40K, llK,40K,53K,40K,lllK,: 111K,53K,lllK,53K,111K, 2K,72Kr72K,72K,72K, 3K,73K,73K,73Kt73K,: 40K,53K,40K,53K,40KV lllK,lllK,111K,111K,111K/DATA ISO/l,1,1,1, 1,1,1,2, 3,1,1,1, 4,6,1,1, 5,6,1,1, : 5,7,1,1, 1,1,8,1, 1,1,9,1, 1,12,13,12, 1,10,11,1/DATA INtI80/-l,2,40000K/ DATA ISP/40Kt10K/

    C IZJG CONTROLS DIRECTION JF PRINTING, TO AVOID UNNECESSARY C CARRIAGE RETURNS. IZIG=l INVL= (IEL-LEL) NOG C OPEN PRINT FILE. CALL OPEN (10, $TTO , I N H ~ ~ ,E~10) IF(IERly.NE.1) GO TO 90 C OPEN DATA FILE. CALL OPEN 2 , 'EVEL ' , ~ , I E R ~ ,75) IF(IER2.NE.l) GO TO 90 C PUT PRINT FILE IN PLOT MODE.TYPE " < 6 > "C OUTER LOOP FOR PRINTING STRIPS. DO 39 MA=IC,JC,145 WRITE (10,1000) MB=MIN0 (MA+l44, C) C LTOT=TOTAL CHARACTER POSITIONS PER LINE. LTOT= (MB-MA+l) 5 C IF IR IS NOT FIRST RECORD, SKIP RECORDS 1 THROUGH KR. IF(IR.EQ.1) GO TO 23 KR=IR-1 DO 24 J=l,KR READ (2,2000 END=90 ERR=90) BUF I) I=l,NCOL) 24 CONTINUE C PROCESS RECORDS. 23 DO 80 IREC=IR,JR

  • 8/8/2019 Simulating forest pictures by impact printers

    8/11

    Subrou tine PATT-Version for NOVA 2/DTC 1200printerlplot ter (continued)

    READ(2,2000,ERR=90,END=90)(BUF(I),1=lrNCOL) 2000 FORMAT(lX,2514) C FIND PATTERN SET FOR EACH DATA VALUE. DO 26 I=MA,MB 26 3UF(I)=MIN0(((BUF(I)-LEL)/INVL)+l,NOG) C STORE AND PRINT CHARACTERS AND SPACING FOR EACH LINE. DO 60 IR=1,4 IL=0 DO 50 IH=MA,MB M=BUF (IH) IF(M.GT.NOG) GO TO 91 IF(M.LT.1) GO TO 91 K=ISQ (IR,M)

    DO 40 L=l,5 IL=IL+1 IF(IL.GT.1450) GO TO 91 LINE(IL)=(IPAT(L,K)) IF(LINE(1L) .EQ.ISP(l)) GO TO 38 IL=IL+1 IF(IL.GT.1450) GO TO 91 38 LINE (IL) ISP (IZIG) 40 CONTINUE 50 CONTINUE C SKIP DIRECTLY TO LINE FEED IF LINE IS ALL BLANKS. IF(IL.EQ.LTOT) GO TO 60 IF(IZIG.EQ. 2) GO TO 56 DO 55 L=l,IL 55 CALL OUTC (LINE L)GO TO 58 56 DO 57 1=1,IL 57 CALL OUTC (LINE IL-I+l)58 IZIG=3-IZIG 60 CALL OUTC (12K) 80 CONTINUE REWIND 2 89 CONTINUE C LEAVE PLOT MODE. TYPE " " NRITE (10,1000) 1000 FORMAT (1H1) RETURN

    C ERROR MESSAGES. 90 TYPE "" WRITE(10,9000),IER10,IER2,IREC ' ,14,6X,' I E R ~ =,14 , 6 ~ ,000 FORMAT FILE ERROR, I E R ~ ~ = 'IREC= ,141RETURN 91 TYPE"" WRITE (10,9001) MA,MB,IH,M,IL 9001 F~R MAT ('~ BAD UBSCRIPT FOR ISQ OR LINE: MArMB,IH,M,1~=',518) RETURN END * >

  • 8/8/2019 Simulating forest pictures by impact printers

    9/11

    Subroutine PATT-Version to run on UNIVAC 1108 (Exec. 8) with standard line printer

  • 8/8/2019 Simulating forest pictures by impact printers

    10/11

  • 8/8/2019 Simulating forest pictures by impact printers

    11/11

    The Authorsare assigned to the Station's research unit investigating measurement andanalysis techniques fo r manag ement planning, with headqua rters inBerkeley, Calif. ELL IOT L. AMIDON is in charge of the measurem ent andanalysis techniques research unit. He earned a bachelor's degree in forestmanagement at Colorado State University (1954) and a master's degree inagricultural economics at the University of California, Berkeley (1961),and was assigned to production economics research at the Station until heassumed his present position in 1971 . E. JOYC E DYE, a com puter pro-grammer, earned a bachelor's degree in geography ( 1973 ) at the Universityof California, Berkeley. She joined the Station staff (Sup port Services) in1961 after nine years on National Forests in Oregon. She has been in herpresent assignment since 1970 .