GPrint 2.03 Black and White Graphics Print Utility for Epson FX printers. Copyright (c) 1988, Peter Cherna Documentation as of October 6, 1988. Contents: 1. Introduction 1.1. Changes Since Version 2.00 1.2. Overview 1.3. Features 1.4. Using GPrint 2. Print Densities 2.1. Low Density 2.2. Medium Density 2.3. High Density 2.4. Ultra Density 3. Print Qualities 3.1. Draft Quality 3.2. Good Quality 3.3. Special Smoothing 4. Summary of Print Modes 4.1. Physical Print Densities 4.2. Relative Time for a Given File 4.3. Relative Time for a Given Area 5. Other Options 5.1. Offset Image 5.2. Center Image 5.3. Invert Image 5.4. Form Feed 5.5. Wide-Carriage Printers 5.6. Suppress Reverse Feeds 5.7. Full Blackness 5.8. Aborting a Print 6. Technical Notes 6.1. Printer Requirements 6.2. Paper Movement 6.3. Perforations 7. Future Enhancements 7.1. Printer Driver 7.2. Workbench Version 7.3. Improved Abort 7.4. Other Printers 8. Final Notes 1. Introduction 1.1. Changes Since Version 2.00 A single bug was discovered in GPrint 2.00. If the width of the picture to be printed is not a multiple of sixteen pixels, then GPrint would not print correctly in Smooth quality (option S). This has been corrected in version 2.03. Now, the picture or brush to be printed may be any arbitrary size. A special algorithm has been implemented which reduces the amount of blackness in Smooth quality (option S). The amount of ink which is placed in solid areas is reduced by up to one half, without any change in the picture quality. The additional processing needed for this algorithm does slow GPrint down slightly, however the algorithm is so successful that it has been implemented as the default. If you prefer the full blackness as was found in GPrint 2.00, use option B. (See Section 5.7). GPrint 2.03 now processes blank lines in a picture (such as often remain at the bottom of a picture file) about four times faster than it did in version 2.00. 1.2. Overview GPrint is a utility that takes any two-colour IFF picture file as input, and prints in on an Epson FX-series or compatible printer. The philosophy behind GPrint is to offer the highest possible quality of graphics printing with the greatest ease. A cornerstone of GPrint is that it provides a direct pixel-for-pixel copy of the picture file on the printer, so that parallel lines, for example, remain of equal thickness. To provide maximum flexibility, GPrint offers a total of nine print modes, consisting of four print densities and three printing qualities (not all combinations are allowed). The print densities range from 80 by 72 screen pixels per printed square inch all the way up to 240 by 216! The highest print quality incorporates a special smoothing algorithm to greatly improve the output look. It is especially effective on text, curves, and diagonal lines or boundaries. GPrint is an essential utility for anyone with an Epson compatible printer who has a need to print graphics, diagrams, charts, or who uses desktop publishing packages such as Gold Disk's PageSetter. It is offered as shareware, meaning that if you find this program useful, you are asked to register by sending a contribution of $10 to: Peter Cherna 5511 Westbourne Ave., Cote St. Luc, Quebec Canada H4V 2G9 Registered owners will be kept abreast of any new versions or updates. Without your support, I cannot afford to work on improvements or other software, so please register! 1.3. Features GPrint is designed to provide the maximum printing speed and quality. For speed, for example, it doesn't ask the print- head to pass over white space to the right of the picture. Nor does the print-head move laterally over completely blank lines. In addition, if there are several blank lines in a row, GPrint queues up this information, and issues one or more large paper feeds instead of a stream of little paper feeds. For the best possible printed look, GPrint avoids asking the printer to perform minuscule paper feeds of the order of one or two hundredths of an inch, which the printer can only perform with some potential for misalignment. Instead, using a special algorithm, it layers its print passes evenly, avoiding tiny paper feed commands, thereby providing a more clean-looking output. GPrint provides numerous print densities and qualities to meet various needs. The resulting print densities go from the relatively low (80 by 72 pixels per square inch) all the way up to the very high (240 by 216 pixels per square inch). The user can then trade off picture size and picture quality vs. time needed for the print. Additional options include setting a left margin, centering the picture, inverting the picture, and issuing a final form feed after printing. Providing the ability to print a pixel-for-pixel copy of a picture file gives the ability to get the best possible print quality. Every printed pixel can be controlled; it is just taken from the picture file. Using the medium print density for example, a full 8" by 11" page can be prepared in Deluxe Paint II from Electronic Arts (960 pixels across by 792 down) or taken from the output of the PageIFF utility of PageSetter. However, this is not even the highest print density an Epson printer is capable of. At the highest density, such a picture file would occupy only one-sixth of a printed page! How can one prepare a large image at a high print density without resorting to an unwieldy sized file (1920 by 2376 pixels) that many programs can't handle? (Deluxe Paint II can't, PAR's Express Paint 2.0 can, given enough memory.) To allow such work, GPrint offers its Special Smoothing mode, which doubles the horizontal and vertical print densities without changing the size of the final printed image or requiring a larger picture file. The simplest way to do this would be of course to just repeat each printed dot horizontally and vertically, but this would produce slightly blocky results. The smoothing mode produces somewhat more pleasing results, as demonstrated on the letter "g" from the Topaz 8 font: *** ** ****** **** ***** *** ** ** ****** **** *** * *** ** ** **** **** *** *** **** **** **** *** *** ** ** **** **** *** *** ***** **** **** *** *** ******** ******* ******** * *** **** **** *** *** **** **** *** *** ********** ********* ********** Original Repeat horiz&vert Smoothing To really appreciate the power of the smoothing algorithm, try out these modes on some of the sample files! 1.4. Using GPrint GPrint runs from the CLI. To activate it, type: GPrint filename [L|M|H|U] [D|G|S] [Onn|C] [I] [F] [W] [R] Where "filename" is the name of the IFF picture or brush file you wish to print. Only the first bit-plane of the file is significant, so normally a single-bit-plane file (2-colour picture) would be used. The file may be of any size, memory permitting, so oversize bitmaps from Express Paint 2.0 or Deluxe Photo Lab may easily be used. Where the options are as follows: L: Low Density (80 x 72 ppsi) M: Medium Density (120 x 72 ppsi) H: High Density (120 x 108 ppsi) U: Ultra Density (240 x 216 ppsi) D: Draft Quality (use with L, M, H, or U) G: Good Quality (use with L, M, or H only) S: Special Smoothing (use with M or H only) Onn: Offset nn tenths of an inch (eg. O5 gives 1/2 inch) C: Center Image F: Issue form feed after printing W: If you are using a wide-carriage (13.6") printer R: Suppress reverse feeds (for MX or RX printers) B: Full-strength blackness (allowed with S only) Notes: - Options can be given in any order, and in either upper or lower case. - 'ppsi' stands for screen pixels per square inch, horizontal x vertical. - The print mode defaults to M,D. Example: To print the picture "df1:MyPicture" in high density with special smoothing, indented 1.5 inches, with a form feed issued after printing, you would type: GPrint df1:MyPicture h s f o15 2. Print Densities GPrint offers four print densities, the choice of which will determine how large a particular picture will appear on the printed page, as well as its aspect ratio (whether it will appear squashed, stretched, or about the same as it looks on the screen.) 2.1. Low Density Low density (option L) puts 80 screen pixels per printed inch horizontally, by 72 vertically. On an 8" printer, a picture 640 dots across will span the page. The aspect ratio of this density is with 5% of the aspect ratio of a 320x200 or 640x400 screen, so objects that are square on the screen will be almost exactly square on the printer. At this density, it is possible to print in draft or good quality, but not with special smoothing. Example: GPrint df1:MyPicture l 2.2. Medium Density Medium density (option M or by default) puts 120 screen pixels per printed inch horizontally, by 72 vertically. When combined with draft quality this produces the print density normally thought of as "standard" on Epson printers. Printing a file produced by PageSetter's PageIFF utility in GPrint's medium draft mode will produce the same print look as the direct printed output of PageSetter. Up to 960 screen pixels will fit on an 8" line. This is a good choice of print density for general work, with the one caveat that to create a square on the printer, you must draw a rectangle that is 5 dots wide for every 3 dots tall, which won't appear square on the screen. At this density, all three qualities (draft, good, and special smoothing) are available. Try printing an existing PageSetter file (saved via PageIFF) in medium density with special smoothing. Compare it to draft output. Example: GPrint df1:MyPicture m or GPrint df1:MyPicture 2.3 High Density High density (option H) is another good choice for general work, and puts 120 screen pixels per horizontal inch, and 108 vertical. The big advantage of high density is that like low and ultra density, its aspect ratio is within 5% of that of a 320x200 or 640x400 screen. Thus, the horizontal stretch of the printed copy is barely noticeable. (Squares stay square and circles stay round.) It is possible to make a picture file big enough to fill a full 8" page in this resolution in software such as Deluxe Paint II. As is the case with medium density, all three qualities are possible at high density. Example: GPrint df1:MyPicture h 2.3. Ultra Density Ultra density (option U) gives a pixel-for-pixel image at the maximum physical print resolution obtainable on the FX-series printers, namely 240 by 216 dots per square inch. This produces beautifully smooth curves, but be aware that the largest picture that Deluxe Paint II can handle fills only about a quarter page at this resolution, and it can be very difficult to manipulate images large enough to be readable in this mode. Also, you will want to use some of the largest fonts available. As ultra density uses the maximum available print density, there are no additional printable pixels which could be used to implement the higher quality modes. Thus, ultra density only works with draft quality. (But the results are still excellent, because the density is so high.) You may find that a solid black area in ultra density is "too black", and gets smeared where the print-head has passed over it. If this is the case, use an older, lighter ribbon (which yours will quickly become if you persist in printing solid black graphics - a square inch of solid black in ultra density or smooth quality high density mode uses as much ink as a double-spaced page of draft-quality text!). The other choice is to pull the print-head away from the printer, using the paper-thickness lever on your printer. Of course, you could also decrease the amount of black in the picture file! Example: GPrint df1:MyPicture u 3. Print Qualities In order to boost the print quality without forcing the user to switch to a higher density and a larger (possibly unwieldy picture file), different print qualities are available. It is important to note that while selecting different print qualities may change the physical PRINT density, the number of SCREEN pixels per square inch remains unchanged for a given density. In other words, changing print quality but not print density will change the look of the output without changing its size. Higher qualities naturally take longer to print. Not all qualities are available in all densities. If you specify an invalid combination, then the desired density will be taken along with the highest allowed print quality. 3.1. Draft Quality Draft quality (option D or by default) can be combined with all four print densities. This is the most straightforward density, in which each screen pixel is represented by precisely one printed dot on the page. It provides the fastest output for a given density, and is useful in many cases, including previewing what a final copy (at a higher quality) might look like (in terms of size). When used with medium density, it produces a "standard" print resolution, like that used in PageSetter, for example. Example: GPrint df1:MyPicture d OR GPrint df1:MyPicture 3.2. Good Quality Good quality (option G) improves the appearance of a printed output by printing each row twice, with the second run just below the first. GPrint automatically sets the printer for double the vertical printed dot resolution for that density in order to make room for these extra dots without changing the resulting picture size. Good quality may be combined with low, medium, or high densities, but not with ultra density. Example: GPrint df1:MyPicture g 3.3. Special Smoothing Think of special smoothing (option S) as being the "near- letter-quality" of graphics printing. Without any extra work on the part of the user, and with just a bit of extra patience for the longer printing times involved, special smoothing can dramatically increase print quality. Special smoothing, which works only with medium and high densities, produces the best possible output by calculating intermediate dots both horizontal and vertical, based on a special smoothing algorithm. GPrint automatically sets the printer for double the vertical and double the horizontal printed dot resolution for the selected density, in order to make room for these extra dots without changing the resulting picture size. For an idea of the power of special smoothing, examine the sample letter "g" given in Section 1.3, but for a real idea, print a file with this option. You will probably use special smoothing along with either medium or high density for most final work. A brief discussion is necessary on one potential pitfall. If GPrint prints a file containing something (such as text) on a screened background (a light grid of dots), you will find that the grid dots adjacent to the text appear to "grow onto" the letters. This is a function of the smoothing algorithm, which can't tell that these dots shouldn't really be attached to the letters. To get around this, ensure that there is a single-pixel white space around each letter. In PageSetter, for example, it suffices to specify any text placed on a screened background as being both "reversed" (\r) and "outlined" (\o), producing black letters (as desired) with the required white outline (as required). In a Paint program, the same white space can be created in a number of ways. As is the case with ultra density, you may find that a solid black area in smooth mode is "too black", and gets smeared where the print-head has passed over it. If this is the case, use an older, lighter ribbon. The other choice is to pull the print-head away from the printer, using the paper- thickness lever on your printer. Of course, you could also decrease the amount of black in the picture file. 4. Summary of Print Modes 4.1. Physical Print Densities The four densities, low, medium, high, and ultra, put 80 x 72, 120 x 72, 120 x 108, and 240 x 216 SCREEN pixels per square inch respectively, regardless of the selected print quality. However, the different print qualities mean that the physical PRINT densities vary from this. The following table shows the physical print densities in dots per square inch (horizontal x vertical) as a function of the mode: Draft Good Smooth Low 80 x 72 80 x 144 - Medium 120 x 72 120 x 144 240 x 144 High 120 x 108 120 x 216 240 x 216 Ultra 240 x 216 - - Note: Very few other printing programs or drivers use 144 dots per inch vertical density, and perhaps none use 108 dots per inch. However, such densities ARE possible on Epson FX printers and compatibles, and are in fact very useful! 4.2. Relative Time for a Given File The various print densities and qualities are provided to give the user maximum flexibility. Of course, for a given file, some modes take longer than others to print, so the following table can be used as a guide for how long each mode takes, normalized so that medium density draft quality is considered to be unity. (Of course, a given file will produce a different sized picture depending on the density chosen.) Draft Good Smooth Low 1.5 3 - Medium 1 2 4 High 2 2 4 Ultra 1 - - 4.3. Relative Time for a Given Area Since some modes print more compactly than others, the following table can be used to estimate the time each mode would take to fill a given printed area (say, for example, one square inch), normalized so that medium density draft quality is considered to be unity. Draft Good Smooth Low 1 2 - Medium 1 2 4 High 1.5 3 6 Ultra 6 - - 5. Other Options GPrint provides several options for added flexibility. 5.1. Offset Image The Offset Image option (option O) can be used to specify a desired left margin in tenths of an inch. Use the letter 'O' (or 'o') followed immediately by the number of tenths of an inch desired. (No intervening space is allowed; in other words, "O5" and "o10" are allowed, but "o 5" won't work.) An offset will cause the printed image to be moved over by that amount. (If the offset great enough, then the picture will be clipped on the right.) To get an offset 1.5 inches, use the following command: GPrint df1:MyPicture o15 The Offset Image option cannot be combined with Center Image (see below). If both are specified, only the last one will be considered. 5.2. Center Image The Center Image option (option C) can be used to position the printed image in the horizontal center of the page. Its use is shown as follows: GPrint df1:MyPicture c The Center Image option cannot be combined with the Offset Image option. If both are specified, only the last one will be considered. 5.3. Invert Image The Invert Image option (option I) reverses the interpretation of black and white in the picture to be printed. GPrint does not consult the colour palette to determine which colour is black and which is white. GPrint by default prints colour 1 as black and colour 0 as white. This works correctly with later versions of PageSetter's PageIFF. In a default Deluxe Paint II two-colour screen, colour 1 will be white, so then anything white on the Deluxe Paint screen would print in black. If you prefer the "look" of paper on the screen, exchange the two colours in the palette (so that colour 0 is black (or dark) and colour 1 is white (or light)). If you've set things up backwards, or have an older version of PageIFF, then GPrint will print a mostly black picture, which not only kills your ribbon very quickly, but it tends to blot out fine white details such as small white text on a black background. Use the Invert Image option to switch this back to normal, as follows: GPrint df1:MyPicture i 5.4. Form Feed The Form Feed option (option F) asks GPrint to issue a form feed after having printed the picture. Note that GPrint does not reset the printer at the beginning of a print, so the top-of-form (to which the form feed advances the paper) remains wherever you set it (i.e. at the paper position when the printer was last reset or turned on.) To invoke the form feed option, type: GPrint df1:MyPicture f 5.5. Wide-Carriage Printers This option (option W) informs GPrint that you are using a wide-carriage (13.6") printer, such as the FX-185 or 286. GPrint will then adjust itself for the extra width, allowing wider pictures to be printed, and centering pictures accordingly. If you leave it out, then all pictures will be truncated at the eight-inch mark. To inform GPrint that you have such a printer, use: GPrint df1:MyPicture w 5.6. Suppress Reverse Feeds This option (option R) is to be used in conjunction with printers that cannot perform reverse paper feeds, such as the Epson MX and RX series. GPrint uses reverse paper feeds to perfectly align the paper before and after a picture is printed. If your printer does not support reverse paper feeds, then a bit of garbage will appear (typically a lower- case "j"). Use option R to avoid this. (However, then there may be a bit of extra space above and below a picture, depending on the print mode chosen.) If you have such a printer, use: GPrint df1:MyPicture r If you are having difficulty with the print-head snagging the paper if you start printing at the very top of the paper (just below the perforation), suppressing reverse paper feeds will be of help. (See Section 6.3, Perforations). 5.7. Full Blackness New in GPrint 2.03 is a special algorithm that reduces the blackness in solid areas of the printout. The algorithm applies only in Special Smoothing mode, and is on by default. It helps to save the ribbon, and produces a cleaner-looking output with less chance of smudging by the print-head or by fingers. If you prefer the full blackness as was found in GPrint 2.00, simply select option B: GPrint df1:MyPicture s b Printing with full blackness on is a bit faster, as GPrint does not need to employ the de-blackening algorithm. The full blackness option does not apply and is ignored unless Special Smoothing is selected. 5.8. Aborting a Print If in the course of printing a picture you wish to cancel the operation, click on the "Abort Print" gadget in the GPrint window that opens in the upper right corner of the screen. GPrint will then stop sending graphics to the printer, and terminate gracefully. Of course, the printer buffer may already contain several lines of graphics, and thus the printer will continue printing even after GPrint stops sending. You may either wait for the printer to finish printing what it has already received in its buffer, or you may shut off your printer. GPrint will exit when it has finished sending graphics to the printer. If the printer is still printing from the buffer when GPrint finishes sending, either wait it out, or shut off the printer. If the "Abort Print" gadget is pressed while the computer is waiting for the printer (eg. if the printer is not on or if it is out of paper), the abort will not take effect unless and until the printer error is corrected (eg. by turning on the printer or loading paper). Otherwise, after about a half-minute of waiting, the printer driver will put up a requester announcing printer trouble. Click on RETRY if you've fixed the problem, or click on CANCEL to abort and exit GPrint. 6. Technical Notes 6.1. Printer Requirements As discussed in Section 4.1, various print densities are used to provide the nine different print modes that GPrint supports. If you have an FX or LX printer or something else relatively recent, all these modes will work. If you have something older like an MX-80 with Graftrax-Plus, then some modes will work, while others won't. This section explains which graphics print modes are used by GPrint, so you can check your printer manual to see if your printer can do what GPrint asks of it. GPrint Modes Epson Code Description LD, LG ESC '*' 4 80 dots/inch MD, MG, HD, HG ESC 'L' 120 dots/inch MS, HS, U ESC 'Z' 240 dots/inch * * in this mode, the printer does not allow two adjacent dots to be printed in a single pass. GPrint uses two- pass printing to overcome this. For example, an MX-80 with Graftrax Plus does not support the ESC 'Z' and the ESC '*' 4 graphics modes. Therefore such a printer can only be used in medium or high density, in draft or good quality. If your printer does not support reverse paper feeds (code ESC 'j' n), be sure to use option R (Suppress Reverse Feeds). (Note that some early Star-Gemini printers are only mostly Epson compatible, and graphics printing was one of the incompatibilities.) 6.2. Paper Movement GPrint causes the paper to do a funny dance at the beginning of every printed picture, and sometimes at the end, also. This is done for two reasons: at the beginning of the picture, it removes any slack in the paper feed mechanism caused by manual paper movements (thus preventing unwanted gaps or overlaps in print passes), and second, GPrint sometimes requires that the paper be rolled back a tiny fraction of an inch before and after printing, depending on the print mode chosen. When GPrint encounters a picture which has a large blank section (say at the bottom of the picture, or possibly a band in the middle), instead of sending dozens of little paper feed commands to the printer (for that machine-gun effect), it queues them up internally and issues them as one or more very large paper feeds, which is less annoying, and faster. Sometimes, especially when printing a wide picture (that has such a gap) with special smoothing, it seems like GPrint may be twiddling its thumbs, but it is actually processing this blank space, and storing up the paper feed commands. It may be momentarily disconcerting, but it is still faster than having GPrint issue a steady flow of small paper feeds. 6.3. Perforations Two problems can be encountered when printing on or near the perforations in fan-fold paper. First of all, slight alignment errors are introduced when the printer is printing near the perforation. This corrects itself when the perforation has passed, and is usually small enough to pass undetected when printing text. When printing graphics, however, the alignment error usually shows up as a small gap or overlap between consecutive print passes that should be just touching. The second problem is more rare, and is that some printers get into trouble when reverse paper feeding near the perforation. If your printer jams or otherwise gets unhappy, start the printing a bit farther down the page if possible, or else use option R to suppress reverse paper feeds. 7. Future Enhancements GPrint has come a long way since version 1, which was used only by myself and a few friends. Since version 1, the high and ultra modes were added. As well, the printer was trained not to send the print-head farther right than the last dot on the line, and not to waste time passing over blank space. All the options listed in Section 5 were added, and the program was made to run several times faster, and is now about half the size of the original. There are still a few things that could be added to GPrint, but Version 2 is here and useful. To give you an idea of what I hope to add, here are a few points. 7.1. Printer Driver GPrint is currently a stand-alone program that prints IFF files. For a fair amount of extra work, the algorithms that GPrint uses could be cast into a printer driver that could then be placed with any program and used to get superb output without having to go through an IFF file to do it. The output from GPrint is still better than the much improved and much ballyhooed EpsonX driver from Workbench 1.3. (The Epson driver from 1.2 doesn't come close to either GPrint or the EpsonX driver!) 7.2. Workbench Version GPrint is the perfect pal for us CLI fans. However, people who freeze at the sight of the little CLI icon also have the right to great print quality. A Workbench version of GPrint with a menu and gadget interface offering the same print quality and options can be arranged. This too would be a fair amount of work. 7.3. Improved Abort Why doesn't the "Abort Print" gadget work if the computer is waiting for the printer to clear its error (out of paper, not on, etc.)? I spent many late nights trying to get this feature to work, but I usually ended up freezing the computer or visiting the Guru. I've now got a pretty good understanding of how the printer device and the parallel device work, and I'm not convinced that this is the same as how they ought to work and are supposed to work according to the documentation. If ever I discover that the problem is mine and the devices actually do work as documented, or if the problem lies with the device drivers and corrected versions are issued, then this will be done right away. The other part of the Abort function that could be improved is the question of graphics that made it to the printer's buffer before the "Abort Print" gadget was clicked. The printer keeps going for a while, even though GPrint has stopped sending stuff, as the user asked. There doesn't seem to be any Officially Approved Way (OAW) to cause a hardware reset of the printer, which would arrest the printing immediately. My best attempt was too successful; it reset the printer and the computer! If someone shows me such an OAW, I'd put it in in a flash. If there's a dirty way of doing it, I'd at least consider it. If there isn't, then it would be nice if Commodore were to provide one. 7.4. Other Printers Some or all of the techniques used in GPrint would apply to other models of printer as well. If there is sufficient interest, I may be willing to create other versions of GPrint that support those printers, for example the Epson Q series, or HP LaserJets and DeskJets. 8. Final Notes I hope that you find GPrint handy and useful. I've kept it to a small size so that you can tuck it on any disk where it might be handy. I've worked hard at testing it to pieces, so there can't be many bugs left. (never say zero!) It has a bright future (there are several interesting enhancements which could be done - discussed in Section 7). At this stage, I have to make one final appeal: there can't be future versions of GPrint nor any stablemates released into the public domain or as shareware if those who find it useful don't register! So please, keep developers developing, and send $10, along with any comments, suggestions, bug reports, etc. to: Peter Cherna 5511 Westbourne Ave., Cote St. Luc, Quebec Canada H4V 2G9 Thank you and enjoy!