home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
542.lha
/
Convert_v2.7
/
convert.doc.pp
/
convert.doc
Wrap
Text File
|
1991-08-10
|
14KB
|
328 lines
===========================================================
Convert.doc - for v2r7 - last updated July 25th, 1991
===========================================================
Credits:
--------
Software created by Pete Patterson for Black Belt Systems
Additional coding by Ben Williams
Documentation written by Ben Williams
Funding by Black Belt Systems
Project: HAM-E hardware support
Introduction:
-------------
The convert tool was created to fill a specific need of the Black Belt
Systems HAM-E product customer base. The HAM-E is a graphics device
which can display color information far more accurately than the Amigas
built in graphics capabilities allow. As such, the HAM-E display
formatting software takes as input CBM standard 24 bit IFF files, the
format defined by CBM specifically for this type of use.
Unfortunately, many otherwise powerful Amiga products such as Impulses
Turbo Silver, Byte by Bytes Sculpt series and some of the PD ray trace
products don't save standard files; instead, they save raw files,
or partially (sometimes totally!) non-conformant "other" formats, some
of which they consider proprietary.
Certain other software products often save image formats that are
designed to take advantage of various features in the Amiga's graphics
system that allow enhancement of certain image modes. HAM-E, SHAM and
Dynamic HiRes are examples of this type of image file. ASDGs "The Art
Department" saves 24 bit files with special chunks in them called
"CLUT" chunks that modify the 24 bit data in various ways. All of these
differing image file formats bring chaos to our supposedly orderly
"standard image format" environment.
The convert tool is able to read many of these file formats, optionally
scale the input file to a new size for output, and write it out as a
completely standard, "100% vanilla" 24 bit IFF file as per the CBM
specification. Once this is done, the resulting file can be sent to the
HAM-E Image Professional software, or any other Amiga tool that can
read 24 bit IFF.
The convert tool has been made available free of charge to our
customers as a service to them. Use by other parties is allowable as
well - note that this is not the same as "public domain" release.
Use of Convert:
---------------
There are basically two types of image files that convert supports.
First, we have "unified" image files. These are files where all of the
iamge information is contained in one file, with enough other
information to allow the convert tool to identify the file type and
then act accordingly. The other is "raw" individual RGB files, where
three individual files make up the complete image; and there is no
information in these files to help the tool know what the file type is,
or what its resolution is, and so on.
If you use convert from the CLI or shell, then you will use the command
switches, documented below.
If you use convert from the workbench, or if you type "convert" without
any command line switches, then you are presented with a user interface
that consists of control panels and buttons. This mode is better suited
for interactive operations. The mouse interface is essentially self-
explanatory.
The command line mode is better suited for script-based operations.
Unified Image File Use:
-----------------------
This consists of simply specifying an input and an output file:
1> convert -i input_file -o output_file
This will take the input file and create a 24 bit IFF output file of
the same resolution. The filenames may be presented in any order, as
long as they are preceeded by the "-i" and "-o" switches. Note that for
Targa format files, you must specify the -t flag anywhere on the command
line. The width and height of the image is stored within the Targa file,
but there is nothing in a Targa format file which identifies it as such.
Raw Image File Use:
-------------------
For any raw RGB file triplet, the "-i" option is not used. Instead,
there are five (5) required command line switches that tell the convert
software how to deal with this image. You must provide the names of
each of the three raw files, as well as the horizontal and vertical
resolution of the image contained in these files. Here is an example:
1> convert -r file1 -g file2 -b file3 -x 320 -y 400 -o output_file
The parameters may be presented in any order, as long as all five of
the -o, -r, -g, -b, -x, and -y switches are present.
You can also use the raw 24 bit input capability to read raw 8 bit
black and white files, and then change these to 24 bit IFF. It's just a
simple little trick, really - just specify the 8 bit raw input file
three times. Lets say that the file is named "satpic". Here is the
command line for reading it in:
1> convert -r satpic -g satpic -b satpic -x 320 -y 400 -o output_file
This "fools" convert into thinking that the RGB values are all the
same, and the result is a B&W 24 bit file.
Optional Output Scaling:
------------------------
For either unified file types or raw RGB files, you have the option to
scale the output file. You can do this as a percentage of input size,
or to specific X:Y output requirements, or a mixture of both
techniques. For the examples we'll use the unified form of the command
since it's shorter and a little easier to understand; but these scaling
options may also be applied in exactly the same way to raw RGB file
conversion operations. Here are some examples:
1> convert -i infile -o outfile -%x 50
This will scale the X axis to 50% of the original size. Since there is
no scale specification for the Y axis, it will remain the original
size.
If you need to scale both axis to 50%, then you specify that for both:
1> convert -i infile -o outfile -%x 50 -%y 50
You can specify the output size directly in pixels, as well. The
following example will create a 320x400 output, regardless of the size
of the input file:
1> convert -i infile -o outfile -px 320 -py 400
And this will scale the x axis to 50% of it's original size while
ensuring a 200 line vertical size:
1> convert -i infile -o outfile -%x 50 -py 200
You can mix and match percent and specific X and Y options as needed;
don't use a percentage and a specific pixel specification for the same
axis.
The scaling options also allow enlargement. For percentages, just
specify values greater than 100; for pixel sizes, if the output size is
larger than the input file size, then the output file will be enlarged
in that dimension or dimensions. Here's an example:
1> convert -i infile -o outfile -%x 200 -%y 200
Unified Image File Formats Supported:
-------------------------------------
1 - 2 color IFF images
2 - 4 color IFF images
3 - 8 color IFF images
4 - 16 color IFF images
5 - 32 color IFF images
6 - 64 color "half-bright" IFF images
7 - 64 color HAM-E register mode single field images
8 - 64 color HAM-E register mode dual field images
9 - 128 color HAM-E register mode single field images
10 - 128 color HAM-E register mode dual field images
11 - 128 color IFF images
12 - 192 color HAM-E register mode single field images
13 - 192 color HAM-E register mode dual field images
14 - 256 color IFF images
15 - 256 color GIF images
16 - 256 color HAM-E register mode single field images
17 - 256 color HAM-E UPB8 brushes
18 - 512 color HAM-E register mode dual field images
19 - 4096 color photon paint IFF images
20 - 4096 color photon paint IFF brushes
21 - 4096 color DigiPaint IFF images
22 - 4096 color DigiPaint IFF brushes
23 - 4096 color Dynamic HiRes images
24 - 4096 color ARZ0 images ("TAD")
25 - 4096 color ARZ1 images ("TAD")
26 - 4096 color AHAM images ("TAD")
27 - 4096 color SHAM images ("info")
28 - 4096 color RGBN images ("Silver")
29 - 262144 color HAM-E ham mode single field images
30 - 262144 color HAM-E ham mode single field, multi-bank images
31 - 262144 color HAM-E ham mode dual field images
32 - 262144 color HAM-E ham mode dual field, multi-bank images
33 - 262144 color "ScanLab" 18 bit IFF files
34 - 16 million color RGB8 ("Silver")
35 - 16 million color 24-bit IFF images with CLUT chunks ("TAD")
36 - 16 million color 24-bit IFF images
37 - 16 million color QRT Trace files
38 - 16 million color DKB Trace files
39 - Targa Type 1 - Colormapped uncompressed images (maps up to 256)
40 - Targa Type 2 - Non-Colormapped uncompressed images
41 - Targa Type 9 - Colormapped RLE compressed images (maps up to 256)
42 - Targa Type 10 - Non-Colormapped RLE compressed images
43 - 16 million color TARGA files (Opticks)
RAW file formats supported:
===========================
44 - R, G, B files
45 - B&W, B&W, B&W files
Available Command Line Switches:
================================
For Help
--------
? ...for list of options
h ...for list of options
-h ...for list of options
help ...for list of options
For Specifying a Unified Input File:
------------------------------------
-i [dev:dir/file] ...unified input file (may include path)
For Specifying Targa Input:
---------------------------
-t ...use -i for Targa file name
For Specifying raw RGB Input Files (All these switches are required):
---------------------------------------------------------------------
-r [dev:dir/file] ...raw red file (may include path)
-g [dev:dir/file] ...raw green file (may include path)
-b [dev:dir/file] ...raw blue file (may include path)
-x [width] ...raw source width
-y [height] ...raw source height
For Specifying the Output File (Required):
------------------------------------------
-o [dev:dir/file] ...24 bit output file (may include path)
For Scaling the output file to a percentage of the input file:
--------------------------------------------------------------
-%x [% value] ...destination image width
-%y [% value] ...destination image height
For Scaling the output file to a specific Pixel Width:
------------------------------------------------------
-px [pixel value] ...destination image width
-py [pixel value] ...destination image height
To change an "over-under" X_Spex image to "Interleaved":
--------------------------------------------------------
-3d ...takes over-under, makes interleaved
To change an "Interleaved" X_Spex image to "over-under":
--------------------------------------------------------
-2d ...takes interleaved, makes over-under
Program revisions from version 1.0 to date:
===========================================
v2r7 - No longer opens VBARs when invoked from the shell or CLI
v2r6 - Fixed bug present in 24 bit save since v2r3. This bug would nuke the
lower two bits of each of the red, green and blue buffers causing the
resultant file to be only eighteen bits. Nobody noticed.....
It was spotted because a user noticed that convert's 24 bit output
files were a good bit smaller than the input 24 bit files form ADPro.
He complemented us on our "good compression", which got us wondering.
Oooops. :^)
v2r5 - Sped up scaling by:
1. rearranging x and y expansion code for 3 or 4 to 1 speed
improvement
2. recoded x and y compression code for 6 to 1 speed
improvement
- Sped up targa 16 bit load by 20% or so
v2r4 - If the user interface is used, the program will loop until the Abort
gadget is selected.
- Assemblerized and optimized most of the rgb conversions including:
GIF
IFF 1 through 8 bitplanes
IFF HAM
IFF Halfbrite
Dynamic Hires
Sliced Ham
many others (so many I forgot 'em all)
Performance increases range from 200% to 600% (maybe even more)
- Fixed several unreported bugs relating to fixed buffer sizes. Most
(I would say all, but that kind of statement tends to come back and
haunt you) routines dynamically allocate line buffers according to
the actual picture width.
- Reworked Targa load routines using TrueVision Targa spec
Convert now supports the following Targa image types
: Type 1 - Colormapped uncompressed images (maps up to 256 entries)
: Type 2 - Non-Colormapped uncompressed images
: Type 9 - Colormapped RLE compressed images (maps up to 256 entries)
: Type 10- Non-Colormapped RLE compressed images
- Fixed Targa bug causing red and blue data to be swapped on Targa 16
images
v2r3 - Fixed bug causing crashes on unknown type Targa images
- Fixed bug in scaling affecting widths > 2048 pixels
- Implemented part of 24 bit save in assembler for 400% speed improvement
- Implemented part of 24 bit load as assembler for 600% speed improvement
v2r2 - Fixed bug in 24 bit save routine with widths > 800
- Fixed bug in scaling which affected brightness
v2r1 - Fixed bug in RAW RGB load (and maybe elsewhere)... if you accepted
either of the default width or height, the program would quit
- 32 bit Targa file support
- 16 bit Targa file support
v2r0 - Fixed bug in Targa conversions
- Added mouse interface
v1r6 - Fixed bug causing crashes if memory allocation failed
- Intergerized scaling for approximately 7x speed improvement
v1r5 - Fixed bug in loading 24 bit files that appeared in v1r4
- Added load of IBM (yech!) Dpaint "LBM" files
- Added load of IBM DPaint non-LBM files (recent DPaint versions)
- Added "shuffle" features to convert from and to X-Spex
compatible 3-d interleaved images
v1r4 - Added support for 18 bit IFF "ScanLab" files
- Added Support for Black Belt paint UPB8 (UnPackedBrush-8) brushes
v1r3 - Added HAM-E ham and reg mode single and multi field loaders
v1r2 - Added ability to read one type of targa file ("Opticks" generated)
v1r1 - Fixed bug in loading RGB8 and RGN files in v1r0
- Added scaling options (-px, -py, -%x, -%y)
v1r0 - Initial release version.