[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

3945.0. "GIF to SHAM converter" by WJG::GUINEAU () Tue Jul 24 1990 13:29

Here is something from Usenet. It converts those (great!) 320x200x256 color
VGA images to Sliced HAM (SHAM). Apparently similar to HAMSHARP but
"much better"...

It's called GIFmachine.

wjg::amiga:gifmach.lzh

Here's the docs:


                                GIFMachine

                 Copyright 1990 by Christopher A. Wichura
                           (caw@miroc.chi.il.us)


Legal mumbo jumbo:

GIFMachine is not in the public domain.  All source files, along with the
resulting executable, are copyright by C. Wichura.  You may not sell
GIFMachine.  The only allowed charge that may be placed on GIFMachine is
for media and/or mailing costs.

GIFMachine may be freely redistributed via BBSs, InterNet/Usenet, and disk
libraries such as Fred Fish's, as long as the archive is not modified.
Disk magazines and services that charge for file transfers may not
distribute GIFMachine.

In using GIFMachine, you accept the responsibility for any damage or loss of
productivity/money that may occur through or during its use.  C. Wichura is
not and can not be held accountable.

                            What is GIFMachine?
                            ~~~~~~~~~~~~~~~~~~~
GIFMachine is a program that converts pictures stored in the CompuServe GIF
(Graphics Interchange Format) format into IFF SHAM format.  There are very
few programs that do this, and most have many problems (not that GIFMachine
doesn't either -- see below).

For a long time, I used a program called ShamSharp to convert GIFs to IFF
format.  ShamSharp was the only thing I would even consider using (execpt
for ASDG's The Art Department, a very fine commercial product!).  However,
there were a number of things about it that irked me.

   1)  If a picture had >16 colours and a width >320, ShamSharp would
       __ALWAYS__ halve the width of the image.  Not only that, but it
       did so by simply skipping every other pixel of the original GIF.
       This resulted in a tremendous loss in resolution.
       
       I, myself, would rather have the entire picture converted and be
       able to use my favorite viewer (Mostra, by S. Vigna) to scroll
       around the image.  Thus, by default, GIFMachine will not halve
       the picture's width.  There is a command line switch to make it
       do so, however, in which case it actually thinks about it a bit
       rather than just dropping the odd pixels.

   2)  If an image had more than 400 lines in it, ShamSharp would
       GURU the system if the SHAM mode flag was used.  GIFMachine handles
       large pictures well (that was one of the primary concerns I had
       while writing it) and has been tested with images as large as
       1152x890!

   3)  ShamSharp would write bad IFF files for me on a regular basis.  I
       suspect this is because of some subtle bug in the cmpByteRun1
       compression routine ShamSharp uses.  Anyway, GIFMachine has yet to
       write a bad IFF on me.  (Cross Fingers, Cross Fingers :-)

GIFMachine also offers the user the ability to automatically remove a
border area in a picture.  (I just hate it when you have an image floating
in the middle of the screen with inches of nothing around it.)

You can also use full ARP wildcards and multiple file specs, much as with
the ARP C:MOVE command.  This eases conversion of a large number of images.

                          Drawbacks of GIFMachine
                          ~~~~~~~~~~~~~~~~~~~~~~~
If you are looking for speed, go someplace else.  GIFMachine was written
with the idea of getting the best possible image from a GIF file, not as
something to view GIFs in a quick and dirty manner.  Usually what I do is
use something like HAMGIF to see if the GIF is actually worth the effort
and then convert a series of GIFs in one shot by specifying multiple
filepspecs.  On a stock 500, the average picture takes around 25 minutes to
convert (half that if the image is interlaced, which is often the case when
the width is halved).

GIFMachine knows how to write only one thing: SHAMs.  If a picture only
uses <= 16 colours, SHAM is not needed.  It would be much faster to write a
normal IFF and skip the SHAM conversion calculations.  In such a case, it
would be better to go back and use something like ShamSharp.

The only viewer I know of that properly handles SHAMs with >400 lines is
Mostra.  SuperSham 3.2 (?) will display the image, but does not allow
scrolling around.  The latest version of Christian Weber's ShowIFF
(included in the v18.? distribution of his iff.library) will also display
SHAMs and let one scroll around.  However, he does not rebuild the copper
list during vertical scrolling and thus the image turns to muck if one
scrolls down.

                             Using GIFMachine
                             ~~~~~~~~~~~~~~~~
GIFMachine requires that you have the arp.library, version 39 or greater,
in your LIBS: directory.  It also requires a fair amount of RAM (though it
does not have to be CHIP RAM or contiguous).  The 1152x890 image required
1.9 megs of memory to convert.

GIFMachine uses the arp GADS() argument parser.  Thus, one can always enter
`GIFMachine ?' on the command line for help.  GIFMachine can not be run
from the WorkBench.

GIFMachine accepts the following arguments:

<filespec1> ... <filespecN> [TO <directory or filespec>] [ALL]
                            [NOBORDER <line thresh>] [XCOMP]

Each filespec may contain any valid ARP wildcards (really regular
expressions).

The TO option allows one to specify where to put the IFFs.  If not given,
they will be placed in the current directory.  It is generally advised that
TO point at a directory.  However, if you are converting only a single GIF
file then there is not reason one can not specify a full filespec.

The ALL option will cause GIFMachine to recursively descend into any
directories while matching filespecs.

The NOBORDER option instructs GIFMachine to remove the border area from an
image.  It takes, as its <line thresh> parameter, an integer between 0 and
100 that indicates what percentage of a line can differ from the border
colour and still have the line removed.

The final option, XCOMP, tells GIFMachine to halve the width of images with
a width >320.

Note that if GIFMachine determines that the image can be written interlaced
(depends on aspect ratios) then it will work on two lines at a time instead
of one.  This is because the SHAM format only changes the base colours
every other line when displaying interlaced images.

-=> CAW
T.RTitleUserPersonal
Name
DateLines