home *** CD-ROM | disk | FTP | other *** search
/ The Grim Reaper 4 / Grim_Reaper_The_Issue_04_1992___BASIC.atr / gr9.doc < prev    next >
Text File  |  2023-02-26  |  2KB  |  1 lines

  1. Mode 9 Pixel Averaging¢----------------------¢¢Written by John E. (TEBSF)¢¢Pixel Average routines by¢Lyn Buchanan.¢¢The first time I came across Pixel¢Average (PA) routines was in issue #20¢of Page 6 Magazine. There was a program¢in it called 'Graphics Workshop',¢which was a drawing program for the¢modes 9/10/11 and it incorperated a PA¢feature.¢PA works by taking a pixel and reading¢the nine pixels around it, adding them¢up and then dividing by nine, this¢would then be plotted over the pixel¢which had just been read.¢The accompanying article with the¢program claimed the PA routine would¢allow 'drawn' programs to look¢digitised. I wondered what would happen¢if this process was reversed and¢digitised pictures were PA'd?¢Unfortunately the program was lacking¢in many departments. Firstly there was¢a text mode with the graphics screens,¢so the whole of a picture could not¢be accessed, also you couldn't PA the¢pixels down the edges of a picture¢because trying to read around one of¢these would give an error-141 because¢the x/y co-ordinates would equal -1¢and so on.¢I though the best thing to do would be¢to write the program from scratch,¢which would fix the limitations of¢the previously mentioned program.¢The actual programming didn't take more¢than an hour, the PA routine worked¢perfectly but there was on major¢snag. It was just too slow!¢The answer was to compile the program,¢thankfully it compiled without problem¢with the MMG Compiler and now the PA¢routine was quite fast.¢¢Using the program is very easy. Just¢enter source and destination filenames¢at the prompt (do not worry you will be¢able to change disks) and the picture¢will load and the PA routine will¢start.¢If you wish to see this taking place¢then press the SPACE bar to turn the¢screen on, although this will slow¢down the actual conversion. Press any¢other key to turn the screen back off.¢When the picture has been fully¢converted, the screen will come on (if¢it isn't already so) and you will hear¢a sound which means INSERT DESTINATION¢DISK AND PRESS ANY KEY. Do this and¢the new picture will be saved to disk.¢Opinion of this program is varied,¢some like it whilst others say it¢just destroys the original picture,¢which in some cases is true.¢Any Mode 9 pictures can be PA'd,¢although I can't recall ever seeing a¢'drawn' Mode 9 piccie!¢