



          [42m Image Processing for a 9-Pin Dot Matrix Printer[0;31;40m[0m

                          [3mby Perry Mowbray[0m



   Ed: Check out also the accompanying illustrations in this drawer.

   PD programs mentioned in this article:
                     Messydos can be found on UT155
                     Tiff2Iff can be found on GR90
                     ImageLab can be found on Fish 452


[32m   <> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <>
[0m

   Since finding out that a friend of mine (who owns a clone), owned a hand
  scanner as well, I have been making good use of it for scanning images to
  put into my tech assignments. The scanner is called an 'A4 scan', and
  looks exactly like those pictures of the genius scanner in ACAR (mind you,
  for all I know, they all might look like that?). It only scanned in black
  and white (1 bitplane), so there was no grey scale. Probably a bit
  primitive compared to some around these days. It was a huge treat to have
  the use of it at all!

   This article is about some of the problems, and some of the discoveries I
  made while scanning on an IBM and printing on a 9pin printer through the
  Amiga.

[42;1mPicture->IBM->Amiga->Printer[0m[0;31;40m

   The process was simple enough, though it did have a few steps to it! The
  scanning was done on an IBM clone, and saved to a 3 1/2" disk in TIFF
  format (huge files those TIFF files!). I use messydos to access IBM disks
  (find it on MD's UT155 disk), and required a programme to convert TIFF to
  IFF (TIFF is unsupported on the Amiga, though Pagestream has a TIFF import
  module, it didn't seem to work with these files! - Mac have TIFF as well,
  maybe it was an old TIFF.)

   The Tiff files were converted to IFF files using Tiff2Iff, using a shell
  line like:

     [33;1m>Tiff2Iff MS1:FILE.TIF Ram:File.iff.[0;31;40m

   These files were then able to be imported into BME (the Pagestream
  companion), touched up, cropped, etc, and then 'published' by Hotlinks. In
  Pagestream, I 'subscribed' to that image (edition), and placed it into my
  assignment. All of which didn't take too long for each image, but when you
  were dealing with dozens, as some of my assignments were, it all took some
  time.

[42;1mScreen->Printer[0;31;40m

   In all this time of using scanned drawings and photos, I have discovered
  one very important thing - they never print out on my 9-pin dot matrix the
  way they look on screen! "Elementary", you say? Well, I guess so. The
  printer manual quotes 'High resolution graphics (240 dpi horizontal * 216
  dpi vertically) [1mfor as much creativity as your software will
  allow[0m.' (bold[0;31;40m added) Um, well?

   In my first assignment (years ago now), the scanned photographs came out
  very dark, and any areas that were any darker than very light grey were
  indistinguishably black. Quite disappointing really. Where the problem
  is, if you missed it a few lines ago, is that the poor old printer has such
  a large pin (9 of them actually) that it's just too coarse to do fine work.
  Like playing hop scotch with oversized flat feet!

   This problem was worsened by the fact that I was reducing the size of the
  imported bitmaps in Pagestream, which tends to increase the problem a wee
  bit. I know that I could have reduced them on a photocopier, but
  photocopied photos are pretty glucky too!

   The solution to the problem can be found in thinning the image's areas of
  dots, ie blobs of colour and lines. This can be done using a few
  programmes, I used a PD one 'ImageLab', which does all sorts of amazing
  things, including the type of convoluting and filtering I needed.

   Noise

   When black and white images are scanned using dots (ie, you generally get
  a choice between small, medium and large dots, or rectangles for scanning
  text), you get what the manuals call noise. (I now sometimes say to my
  wife, "What's all this noise on the floor?", Imagining (imaging) the
  clamour the kids would have made in making it!). Anyway all this noise
  (the scanner interprets greys into this noise as well!) gets combined into
  black masses on my printer. So I 'Filtered' the image, which tests each
  pixel with those surrounding it (a 3*3 matrix), and places the lowest value
  of the 9 pixels tested at the centre.

    0 1 0  if this is a group of pixels,  +-->   0 1 0
    1 [1m1[0m 0  it will test the centre one    |      1 [1m0[0m 0[0;31;40m
    1 1 1  (bold) and alter it to the     |      1 1 1
           lowest value, ie --------------+

   The filtered image has all the single pixel dots removed, and all other
  masses of dots reduced in size; and it prints perfectly, and, if it's not
  quite perfect, we can filter it again until it is! See a representation of
  some typical results in picture_1 in this drawer.

[42;1mPicture 1[0;31;40m

   This is taken from one of my scans that I used in an assignment on street
  trees. I've just duplicated one section four times.

   The original is in the top lefthand corner. The other three have been
  filtered or averaged as indicated.

[42;1mBut is it art?[0;31;40m

   When photographs are scanned, it requires even more experimentation;
  though I was able to get some very interesting and acceptable 'arty'
  results for title pages by working and reworking the images. If the
  original scans were grey scale it would have been a lot easier, but as it
  is, there is a lot of scope for experimentation! I found if you 'filtered'
  a photo, you would basically lose the image's recognition (as it is almost
  completely made up of 'noise', being a 1 bitplane scanner options available
  in ImageLab!

   One experiment that got some amazing(?) results was to alter the palette
  from 2 colours to 16 colours, set the different colours, and start
  convoluting the image in various ways. The resulting images were pretty
  (ie colourful), but not recognizable in any way in the end. See picture 2.

[42;1mPicture 2[0;31;40m

   Picture 2 is a copy of picture 1 and altered as described above. The
  quarter that was the original was averaged three times (this process takes
  the colour index of the matrix pixels and averages them, placing that index
  at the centre, therefore changing the colour.

   The one in the righthand corner was laplacian convolved (highlights
  outline edges) and then vertically averaged twice.

   The bottom lefthand corner was diagonally averaged three times.

   The bottom righthand corner was Roberts tranformed (outline tracing).

   As you can see, colourful, and quite handy if you need an abstracted
  design as a cover or logo, but not brilliant if you need to say something
  exactly with your image!

[42;1mPhotos for a 9 pin[0;31;40m

   The most successful method was to first change the palette to a 16 colour
  scale; then grey scale it (ImageLab sets the grey-scale values
  automatically), mind you, our picture won't change in any way because even
  though the palette is 16 grey scales, the pixels are only black or white
  (you can though grey scale a colour image, which is very handy for B&W
  printing!).

   The next task was to pixelize the image - like they do for court reporting
  on TV when the criminals don't have a bag! The resultant image is then
  averaged to 'soften' or blur the blocky appearance of the image. The final
  task was to lighten it, so that it would not print too dark on the printer.
  That is, if the pixel was scale 5, it would lighten it by 1. The final
  image was very acceptable - especially for a 9-pin dot matrix! Sort of
  like a primitive grey scale, so when Pagestream printed it out, it also
  'screens' the image into dots of varying sizes for the printer, it produced
  a readable print, which was composed of tiny soft squares.

   This is not a plug for ImageLab as such, from MD_32 it sounds as if
  ImageFX and ADPro etc do the same sort of things, and I know that I could
  have used a bureau or something if it was important; but the results are
  perfectly adequate for the level required for tech, and even a lot of
  printing jobs where the resolution is not high.

A final note:

   The biggest job in image processing (on an unaccelerated 500), is
  waiting.  Imagelab takes almost forever to process some images! I'd almost
  be tempted to set Ami to work last thing at night, and retrieve the image
  in the morning!

Messydos can be found on UT155
Tiff2Iff can be found on GR90
ImageLab can be found on FISH452


   Motto: "If at first it doesn't look right, keep changing it until it does!"


[32m   <> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <%> 34 <>
[0m


