Sao2Pgm version 1.0 What is it? Basically sao2pgm is a very basic converter from the unusual R4 raw binary image format to a 8 bit deep PGM P5 file. What is the R4 image format? Well, R4 is not actually an image format; in fact it is basically a raw concatenation of 32 bit floating point values. This type of file is often used to store real digitised images from some instrument (e.g. the HST camera, HST being Hubble Space Telescope) and moreover is damn easy to read and write in every programming languages. Why did you to write it? At University we use to display R4 files with SaoImage on our Suns; at home I could not find any Amiga utility capable of doing this, so i decided to write this quick hack. What is PGM P5? PGM is part of PPM; PGM is used to display grey scale images. Actually sao2pgm writes only P5 8 bit files; P5 is a variant of PGM and is faster to read and write than PGM P2 so I opted for that; with 8 bit you get 256 shades of grey. Why is it shell only? and why is its interface so ugly? Cause I had to mantain source level compatibility with Unix and so I could not use Amiga specific futures. :( However some standard Ansi functions were substituted with Exec and Dos ones where possible. Why is it so buggy? Well I can't tell you. I've used for several months now and on my system all is fine. Contact me if you have problems. Installation: In the achive you will find two versions of sao2pgm: - sao2pgm.000 for vanilla 68000 systems - sao2pgm.881 for 680X0+68881 systems where X>1 simply copy the sao2pgm that fits your system where you want. Minimum Requirements: Amiga computer :) OS V2+ Ram Requirements: With 2Mb RAM you should be able to convert 512x512 R4 files. Sao2Pgm is considerably faster if it can allocate FAST RAM instead of CHIP. Usage. Syntax: sao2pgm where and are the dimensions of the image is the full filename for the R4 raw binary file is the full filename for the PGM outfile after that you'll get some basic information about the infile min,max: the minimum and maximum pixel float value range : the max-min value mean : the average pixel value sigma : the standard deviation from the mean then you'll be questioned about conversion method linear: the data is simply scaled linearly y = norm * (x-min) logarithmic: the data is scaled with logarithm y = norm * log(1+(x-min)) sqrt logarithmic: the data is scaled with square root logarithm y = norm * sqrt(log(1+(x-min))) average: the values distant more than two sigma from the mean value are rejected; then you'll be asked for a linear,log or sqrt-log transformation. then choose if you would like to have IGSQ IGSQ(Improved Gray Scale Quantization) is used to make a better quantization for the human sight. It introduces a degree of randomness in the less significant bits of the image to simulate a more smooth appearance; however the improvement on 8 bit images is questionable. then choose if you would like to have HE HE(Histogram Equalization) is used to enhance the contrast and to improve dynamic range of an image. finally you may choose a flipping method among None : do not flip FlipX : flip orizontally FlipY : flip vertically FlipX&Y : flip orizontally and vertically Cross : flip "in cross" Food for thoughts: look closely at the statistical values printed; in particular pay attention to the mean and sigma of the pixel value distribuition: if you see that the image has a very broad range and a narrow deviation choose an average transformation. Logarithmic and sqrt-logarithmic scaling methods are used to highlite the most dim shades; when used with an average transformation choose preferably a linear quantization. Do not choose IGSQ nor HE if you intend to post process the pgm files, these operations alter the true information contained in the image. Do not choose IGSQ if you are low on memory. Cross flipping is most useful when used with 2D FFTs. Credits, flames, etc.. to Stefano Agostinelli via Vesuvio 12/11 16134 Genova - ITALY IRC: arm E-mail: agos001@pn.itnet.it