!PNG2SPR
========

-------------------------------------------------------------------

  Manual for !Png2Spr.
  Version 1.34
  Copyright  Tom Tanner, 1995-2002
  email ttehtann@argonet.co.uk
  1 Brunel Drive, Biggleswade, Beds SG18 8BT, UK

-------------------------------------------------------------------


This program allows conversion of graphics in the new "PNG" format to Acorn
sprite files, and vice versa. Note that due to the Acorn sprite formats, the
program converts 16 bit RGB colours to 8 bit RGB colours. Also, transparency is
an on / off mask.

The PNG web pages (specifications & example files) are to be found at
http://www.cdrom.com/pub/png/

To convert a PNG file (type B60), double click the file, or drop the file onto
the program icon on the icon bar. To save the file when converted, click the
menu button over the displayed picture, and drag the sprite to where you want
to save it, or type in a path name and click OK.

To convert a sprite to a PNG file, drop the sprite onto the iconbar icon.
Currently there are no conversion options, apart from the "Use Gamma" item on
the iconbar menu - if this is ticked, the file is given a gamma correction of
1 / 1.8 (the inverse of my guess at the gamma value for my monitor!).

Warning: In order to facilitate some of the conversions, !Png2Spr will perform
palette optimisation to remove unused colours.

Icon Bar Menu:

Info		Standard useless program info

Single Task	When ticked. the program does not release control to the wimp.
		It therefore converts faster (but you can't do anything else!).
		Off by default.

Use Scale	When ticked, the program uses the "pHYS" chunk in the file (if
		supplied) to scale the picture. NOTE: The size is not
		guaranteed - I will supply some method of configuring real
		pixel sizes in a later version. On by default.

Use Gamma	When ticked, the program uses the "gAMA" chunk in the file (if
		supplied) to apply gamma correction. On by default.

Viewer Mode	When ticked, supresses queries about unsaved files on closing /
		quitting

Transparency	When clicked, brings up a screen allowing you to select
		transparency options, as follows:
		Ignore		Ignore transparency / alpha channels (all pixels
				considered opaque).
		Create mask	Create a mask (pixels whose opacity is less
				than the slider value are considered
				transparent).
		Use Background in bKGD chunk
				If bKGD chunk supplied, use it. Otherwise
				use the colour selected by the button.
		Use specified colour
				Always use the colour selected by the button.

Save Options	Save the above state of ticks above for the next time you run
		the program.

Quit		No prizes for guessing the effect of this one!

The program supports the Acorn desktop save and help protocols.

Command Line Usage
------------------

<!Png2Spr$Dir>.!RunImage [[-option_file] source dest]
option_file (NB DON'T call the first option file "wimp") contains options as
follows (this is the same format as the choices file):

Version=1.3
SingleTask=0
UseGamma=0
UseScale=0
ViewerMode=1
BgRed=61166
BgGreen=61166
BgBlue=0
MaskThreshhold=128
BgMode=1
BgGray=65535

SingleTask & ViewerMode will be ignored. The mask threshold is from 0 to 255.
The Bgxxx values are from 0 to 65535 and correspond to the "Transparency"
options screen. Note that the default options file is read first. 

Note: You can't currently omit or reorder any lines.

If <source> is a PNG file, it will be converted to a sprite, and vice-versa.
The entire command line is processed and errors are merely printed on the
standard output.

Known Bugs:
-----------
	8bpp sprite files with no duplicate colours in the palette will
	lose their masks.
	sBIT is not dealt with, so converting a 32k sprite to a PNG and back to
	a sprite results in a 16M colour sprite.

Future Enhancements:
--------------------
1	Allow specification of compression & interlacing when converting
	sprite files.
2	Tidy up interface (again)
3	Lots of others which are in the source code...

Tedious legal message
=====================

   This application is freeware. It can be distributed freely as long as only
reasonable charges are made for media and distribution. I retain copyright on
all program code and documentation contained in this distribution.

   This software is supplied asis: I make no warranty, expressed or
implied, of the merchantability of this software or its tness for any
particular purpose. In no circumstances shall I be liable for any damage,
loss of prots, or any indirect or consequential loss arising out of the use
of this software or inability to use this software, even if I have been
advised of the possibility of such loss.

   In other words, if your computer crashes, blows up or turns into a PC, or
you lose all your work, etc., all because of !Png2Spr, dont blame me.

Acknowledgments
---------------

Thanks are due to:

Greg Roelofs, for being helpful

Nick Smith, ANT Ltd, for sending me the official PNG sprites and pointing out
that I can't spell my own name.

Nick Roberts ("tigger@argonet.co.uk") for using the program and making some
suggestions to improve it.

Stewart Brodie for doing much the same

The producers of the Zlib & PNG support libraries

Copyrights
==========

The PNG support library (libpng) is copyright as follows:-

Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
(libpng versions 0.5, May 1995, through 0.89c, May 1996)
Copyright (c) 1996, 1997 Andreas Dilger
(libpng versions 0.90, December 1996, through 0.96, May 1997)
Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson
(libpng versions 0.97, January 1998, through 1.0.6, March 21, 2000)

For the purposes of this copyright and license, "Contributing Authors"
is defined as the following set of individuals:

   John Bowler
   Kevin Bracey
   Sam Bushell
   Andreas Dilger
   Magnus Holmgren
   Tom Lane
   Dave Martindale
   Glenn Randers-Pehrson
   Eric S. Raymond
   Greg Roelofs
   Guy Eric Schalnat
   Paul Schmidt
   Tom Tanner
   Willem van Schaik
   Tim Wegner

The inflate / deflate support library (zlib) is copyright as follows:-

   Copyright (c) 1995-2002 Jean-loup Gailly and Mark Adler
