4. Tools

Tools provided by the N64 JPEG library are described below.

4.1 njpgCompress Tool

Use the njpgCompress tool to compress a graphic image (16bitRGBA format) into N64_JPEG format.


njpgCompress(1P)

Function Name

njpgCompress --> to compress a graphic image (16bitRGBA format) to N64 JPEG format.

Syntax

njpgCompress [-w width][-h height][-s scale]
			[-v] inFile outFile

Description

The following command line options are available for the njpgCompress tool:

-w width
The width of the image (default = 320). It must be a multiple of 16.

-h height
The height of the image (default = 240). It must be a multiple of 16.

-s scale
The scale of the quantization table (-2<scale<2, default = 1).
If this value is small, the image quality is improved but the compression ratio goes down. Conversely, if this value is large, the image quality falls but the compression ratio goes up.
If the scale = 0, there is no quantization.

-v
Switches ON verbose mode. When this option is included, information about the image, such as the compression rate, is shown during the compression process.

inFile
The name of the graphic image file(16bitRGBA format). Use the rgb2u64 tool to put your input file into 16bitRGBA format if necessary.

outFile
The name of the output file.


4.2 njpgMakeSlide Tool


njpgMakeSlide(1P)

Function Name

njpgMakeSlide --> compress 1 or more 16bitRGBA format graphic images into N64 JPEG format.

Syntax

njpgMakeSlide [-w width][-h height][-s scale]
			[-v] inFile outFile

Description

Use the njpgMakeSlide tool to compress one or more 16-bit RGBA-format graphic images into N64 JPEG format and place the result into a single file. This is useful for making a file of all background images or for using images continuously as slides or flip animation pictures.

Command options are as follows.

-w width
The width of the image (default = 320). It must be a multiple of 16.

-h height
The height of the image (default = 240). It must be a multiple of 16.

-s scale
The scale of the quantization table (-2<scale<2, default = 1).
If this value is small, the image quality is improved but the compression ratio goes down. Conversely, if this value is large, the image quality falls but the compression ratio goes up.
If the scale is scale = 0, there is no quantization.

-v
Switches ON the verbose mode. When this option is included, information about the image, such as the compression rate, is shown during the compression process.

inFile
The name of a text file that lists the names of all the graphic image(16bitRGBA format) files. Use rgb2u64 tool to create 16bitRGBA format images.

outFile
The name of output file.


4.3 rgb2u64 Tool

Each original image file must be in the 16-bit RGBA format before it can be compressed into the N64 JPEG format. You can use this rgb2u64 tool to convert an image from RGB format into 16-bit RGBA format.


rgb2u64(1P)

Function name

rgb2u64 --> to convert images in RGB format to 16bitRGBA format

Syntax

rgb2u64 <infile> [x_size y_size] > <outfile>

 

Description

This tool converts images in RGB format to 16-bit RGBA format. This tool is used on an SGI workstation.

Command options are as follows.

infile RGB format input file
outfile 16bitRGBA format output file. Note that redirect (>) is used to output data to a file.
x_size y_size With X,Y directions of the image specified, that region is cut out and it converts it to 16bitRGBA format. The original image is cut in the top, bottom, left, and right sides.