Compress Factor image file for loading by the VM


The tools.image-compressor vocabulary compresses Factor images such that the VM can load it and decompress it on the fly. Compressed and uncompressed Factor images are both supported by the VM and are only determined by their image headers.

You can also run the compressor on the current Factor image directly from the commandline:
factor -run=tools.image-compressor [ -c <level> ] [ <input> [ <output> ] ]


The following arguments are supported:

-c <level> defines the compression level (1..22, default 12)

<input> if given compress this file, else the current Factor image

<output> if given save result into this file instead of overwriting input file

To uncompress a compressed Factor image, you can start Factor with
factor -i=<compressed image>

then save-image-and-exit

Embedded images in executables such as those created by the tools.deploy tool, can also be directly loaded, compressed, and saved.

Examples

factor -run=tools.image-compressor

factor -run=tools.image-compressor -c 1 hello-ui.exe

factor -run=tools.image-compressor -c 18 factor.image factor.image.compressed