PaletteConverter

... anything more to say?

Introduction

PaletteConverter is a command line utility for the Microsoft Windows operating system for converting colour palettes (colour maps) between different formats. PaletteConverter currently supports the following formats:

Each of these formats can be used as input and the read palette can be written in one of these formats.

The following formats can be exported only, but not read:

Additionally, PaletteConverter can render palettes to .gif-files (see below).

Test/Purchase

PaletteConverter is a commercial product. The licence fee is €10 (approx. 10US$). The licence allows to install the application on any number of computers, provided only one person can use it. Installing PaletteConverter as a web service is not allowed.

Download Shareware Version

The trial version (v1.4.0) for Windows may be used for evaluation only and is limited - well, let's say crippled - as following:

Download PaletteConverter Shareware Version (version 1.4.0, zipped archive)

Download PaletteConverter Shareware Version (version 1.4.0, Microsoft installer)

Purchase Full Version

You can obtain a licenced copy of PaletteConverter via PayPal. A window will open within which you can process your payment and download a licenced version afterwards. The current release (1.4.0) contains the uncrippled executable. We give a strong advice to save the file to a known folder.

Es erfolgt kein Ausweis der Umsatzsteuer aufgrund der Anwendung der Kleinunternehmerregelung gem. § 19 UStG.

Usage

A basic call looks like this:

paletteconverter.exe -i myOrigPalette.aco -o myNewPalette.gpl

This call lets PaletteConverter read the palette file defined by the option -i and write it into the file defined by the option -o. As both files have correct extensions, .aco and .gpl, respectively, PaletteConverter knows that the file to read is an Adobe Photoshop palette named "myOrigPalette.aco" and that the file to write should be a GIMP palette named "myNewPalette.gpl".

Rendering an image is done by a call like the following one:

paletteconverter.exe -i palette.map -o palette.gif

Here, the extension .gif forces PaletteConverter to write the palette as a .gif-image.

File Processing

The file to read is given to PaletteConverter using the --input <PATH>[,<PATH>]* (or -i <PATH>[,<PATH>]* for short). As you may have noticed, more than one path can be given, separated using a ','. <PATH> may be either the name of a file itself, including wildcards, or the path to a folder. In the second case, you should additionally set the option --recurse to walk down the folder tree.

The output path is defined using the option --output <PATH> (or -o <PATH> for short). If only one file is converted, the option should contain the name of the file to generate. You may omit to define the output format, if this file's extension is known to PaletteConverter, see below.

If no output path is given, the name of the file(s) to generate is constructed by appending the output format's extension to the name of the converted input file without extension. Please note that the output format must be given in this case. If the output path is given and more than one file shall be converted, each output file name is constructed as:

OP := <INPUT_PATH><OUTPUT><TO_FORMAT_EXTENSION>

where:

Defining the Input/Output Formats

PaletteConverter recognizes the file format of input and output files by extension. In the case your files have a different or none extension, you have to let PaletteConverter know the format of the files to read. This is done using the option --fromformat <FORMAT> (or -f <FORMAT> for short). The same counts for output files. If no known extension is given for the output file, you have to specify it using the --toformat <FORMAT> (or -t <FORMAT> for short) option.

The following table shows which extensions are assigned to which formats and the used format name:

ExtensionFormatFormat Name
.gplGIMP palettegpl
.acoAdobe Photoshop paletteaco
.mapFractint palettemap
.palMicrosoft palettepal
.hextxtA list of RGB-hex-triplets, one by linehextxt

PaletteConverter can generate some further representations, but they cannot be read as they are no original palette formats:

ExtensionFormatFormat Name
.htmlA HTML tablehtml
.cssA CSS color listcss
.jsA JavaScript list definitionjs

Additionally, PaletteConverter writes the following image formats, which are as well recognized by their extension:

ExtensionFormatFormat Name
.gifGIF (Graphics Interchange Format) Image Filegif

Image Generation Options

If no further options are given, PaletteConverter writes all colours as single pixels into one line:

paletteconverter.exe -i palette.aco -o palette.gif

Result:

The parameter --columns <INTEGER> defines after how many columns, a new line shall be started. The height of a colour cell can be changed using --cell-height <INTEGER> (-h <INTEGER> for short). Its width can be accordingly changed using --cell-width <INTEGER> (-w <INTEGER> for short).

paletteconverter.exe -i palette.aco -o palette.gif -w 8 -h 8 --columns 16

Result:

Please note that only palettes of no more than 256 color entries can be used for image generation.

Formatting CSS lists

The defaults render .css-entries like this:

.pal_example_0 { background-color: #000000; }
.pal_example_1 { background-color: #900ae5; }
.pal_example_2 { background-color: #9309e3; }
.pal_example_3 { background-color: #9608e1; }
...

Where "example" is the name of the palette - either as set on the command line using the --name <NAME> option, as given in the read palette file, or as derived from the palette's file name. The parameter --css.attribute <NAME> sets the name of the attribute. The default is "background-color" as seen above. The parameter --css.name <FORMAT_STRING> is a format string template that describes how the names of the entries shall be encoded. E.g. if one wants to use .mypalette_<INDEX> as name for setting the font color, the following call could be used:

paletteconverter.exe -i palette.aco -o palette.css --css-name ".mypalette_%i" --css-attribute font-color

This would result in:

.mypalette_0 { font-color: #000000; }
.mypalette_1 { font-color: #900ae5; }
.mypalette_2 { font-color: #9309e3; }
.mypalette_3 { font-color: #9608e1; }
...

Formatting JavaScript lists

By default, JavaScript-palettes are rendered like:

var <NAME>=[ <HEX_LIST> ];

Where the <HEX_LIST> consists of entries that are divided by a colon (',') and are formatted as:

"#RRGGBB"

You may change how the name is rendered using --js.name <FORMAT_STRING>. Instead of writing every colour entry as a hex-string, one may as well force PaletteConverter to write RGB-triplets using --js.type triplet.

Formatted String

At some places, a FORMAT_STRING is used. The string may contain placeholders for current values, e.g. the color table entry's index. The following placeholders are supported:

Reporting

You may find the obligatory --verbose (or -v) option which shows some more output. You can force PaletteConverter to write the files it processes using --print-files and if you do, you can define the prefix to use using --print-files.prefix <STRING> and the divider to use using --print-files.divider <STRING>. You can also print the set options using --print-set-options.

Appendices

Options Summary

File Options
-i <PATH>[,<PATH>]*
--input <PATH>[,<PATH>]*
Defines the files to read; paths are accepted as well.
-f <FORMAT>
--fromformat <FORMAT>
Defines the input format.
-o <PATH>
--output <PATH>
Defines the name of the output file.
-t <FORMAT>
--toformat <FORMAT>
Defines the output format.
--recurse Enables recursion into subfolders.
Image Output Options
-w <INTEGER>
--cell-width <INTEGER>
Defines the width of a colour cell in pixels.
-h <INTEGER>
--cell-height <INTEGER>
Defines the height of a colour cell in pixels.
--columns <INTEGER> Defines the number of columns after that a new line is started.
CSS Export Options
--css.name <FORMAT_STRING> A format string that defines how the names of the css-entries are generated.
--css.attribute <NAME> The name of the attribute to assign the color to.
JavaScript Export Options
--js.name <FORMAT_STRING> A format string that defines how the name of the palette is generated.
--js.type <NAME> Defines how the entrie shall be rendered (one of "hex" or "triplet").
Reporting Options
-v
--verbose
Enables verbose reporting.
--print-files Prints the files that are processed.
--print-files.prefix <STRING> Defines the prefix to be used.
--print-files.divider <STRING> Defines the divider between files.
--print-set-options Prints option values before processing.
--print-summary Prints a summary after processing.
Help and Version Options
-?
--help
Prints the help screen and stops.
--version Prints the application version and stops.

History

Disclaimer

The software is provided "AS IS". It did not hurt us, yet, and even worked as expected and there are even tests which prove it. Though we cannot guarantee it will work as you expect.

Daniel Krajzewicz
Jochen-Nüßler-Straße 44
12359 Berlin
USt-IdNr.: DE281155133
Your message
Name:
E-Mail:
Subject:
Message:

Supporting an e-mail address allows us to answer.

Your message has been sent. Thank you.