Jpeg2Spr
========

Version 1.11 (22 June 2003)
------------

Jpeg2Spr is a command line utility to convert JPEGs to sprites. It uses
the JPEG SWIs in SpriteExtend 0.99 so you will need RISC OS 3.6 or
later, or RISC OS 3.5 and the SpriteExtend module available from Acorn's
FTP site.

I have heard of a module which implements dummy dynamic areas on
RISC OS 3.1, so it should also now be possible to use Jpeg2Spr on these
machines. To this end I have replaced the mode-reading call to one
compatible with RISC OS 3.1.

Results are not such high quality as ChangeFSI, but Jpeg2Spr is much
quicker.

I haven't had a chance to test it under a wide range of conditions, but
it seems reliable enough with various JPEGs from the SlideShow
collection and some downloaded from the Internet.

This version is 32-bit compatible, so the new SharedCLibrary etc must be
loaded first:- see the JpegRun file.

Syntax
------

Jpeg2Spr <JPEG file in> <Sprite file out> {Mode} [-{d0|d1|d2}{h}{c}]

where -dn controls the dithering quality:

-d0 : No dithering
-d1 : Simple fast dithering
-d2 : Error diffused dithering (256 colour modes only)

The default is d2 (used to be d1)

-h means the hourglass won't be switched on while Jpeg2Spr is running.

-c means use ChangeFSI if SpriteExtend can't handle this file. The command
passed to ChangeFSI is:

ChangeFSI <JPEG file in> <Sprite file out> <Mode> -nomode

The {Mode} argument is not used otherwise, so it is optional for
Jpeg2Spr, but if it is not used and ChangeFSI is called, be warned you
will probably end up with a Mode 0 sprite.

Examples:
---------

Jpeg2Spr <Wimp$ScrapDir>.JPEG <Wimp$ScrapDir>.Sprite
| Simplest usage

Jpeg2Spr <Wimp$ScrapDir>.JPEG <Wimp$ScrapDir>.Sprite -d1
| Lower quality dithering

Jpeg2Spr <Wimp$ScrapDir>.JPEG <Wimp$ScrapDir>.Sprite -hd0
| No dithering and no hourglass

Jpeg2Spr <Wimp$ScrapDir>.JPEG <Wimp$ScrapDir>.Sprite -c
| Use ChangeFSI if the JPEG is unrecognised

Use with Termite
----------------
Shift double click on !Termite and copy Jpeg2Spr and JpegRun into it.
You now need to tell Termite to use Jpeg2Spr instead of ChangeFSI. Good
luck with Termite's Style Editor, you may need it! Alternatively you may
be better off editing the text files that determine the styles.

The command you need to enter in the Image helper style is:

<Termite$Dir>.JpegRun %0 %1 %2

The options can go either before or after the %x parameters (but see
below).

Termite rather dumbly asks its image helper to decode images that don't
exist or have failed to download. To save time if you have RISC OS 3.5+
you can use the JpegRunR file instead of JpegRun; it checks for the
existence of the file with the IfThere command before calling the
helper. It might not make any difference on RISC OS 3.5, because the
IfThere command is soft-loaded on that version of the OS.

If you use JpegRunR you must type the image helper command into
Termite's style exactly as above, and any options *must* *follow* the
parameters.

Contacts
--------
Tony Houghton
271 Upper Weston Lane
Southampton
SO19 9HY

riscos@realh.co.uk
http://www.realh.co.uk/riscos/
