mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
221 lines
11 KiB
HTML
221 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<!-- This is an automatically generated file. Do not edit.
|
|
This file is part of RGBDS.
|
|
|
|
Copyright (c) 2013-2018, stag019 and RGBDS contributors.
|
|
|
|
SPDX-License-Identifier: MIT
|
|
-->
|
|
<head>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta charset="utf-8"/>
|
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
|
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
|
|
<title>RGBGFX(1)</title>
|
|
</head>
|
|
<body>
|
|
<table class="head">
|
|
<tr>
|
|
<td class="head-ltitle">RGBGFX(1)</td>
|
|
<td class="head-vol">General Commands Manual</td>
|
|
<td class="head-rtitle">RGBGFX(1)</td>
|
|
</tr>
|
|
</table>
|
|
<div class="manual-text">
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
|
<code class="Nm">rgbgfx</code> —
|
|
<span class="Nd">Game Boy graphics converter</span>
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
|
<table class="Nm">
|
|
<tr>
|
|
<td><code class="Nm">rgbgfx</code></td>
|
|
<td>[<code class="Fl"><a href="#C">-C</a><a href="#D">D</a><a href="#h">h</a><a href="#m">m</a><a href="#u">u</a><a href="#V">V</a><a href="#v">v</a></code>] [<code class="Fl"><a href="#f">-f</a></code> |
|
|
<code class="Fl"><a href="#F">-F</a></code>] [<code class="Fl"><a href="#a">-a</a></code>
|
|
<var class="Ar">attrmap</var> | <code class="Fl"><a href="#A">-A</a></code>]
|
|
[<code class="Fl"><a href="#d">-d</a></code> <var class="Ar">depth</var>]
|
|
[<code class="Fl"><a href="#o">-o</a></code> <var class="Ar">out_file</var>]
|
|
[<code class="Fl"><a href="#p">-p</a></code> <var class="Ar">pal_file</var> |
|
|
<code class="Fl"><a href="#P">-P</a></code>] [<code class="Fl"><a href="#t">-t</a></code>
|
|
<var class="Ar">tilemap</var> | <code class="Fl"><a href="#T">-T</a></code>]
|
|
[<code class="Fl"><a href="#x">-x</a></code> <var class="Ar">tiles</var>]
|
|
<var class="Ar">file</var></td>
|
|
</tr>
|
|
</table>
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
|
The <code class="Nm">rgbgfx</code> program converts PNG images into the Nintendo
|
|
Game Boy's planar tile format.
|
|
<p class="Pp">The resulting colors and their palette indices are determined
|
|
differently depending on the input PNG file:</p>
|
|
<ul class="Bl-dash">
|
|
<li>If the file has an embedded palette, that palette's color and order are
|
|
used.</li>
|
|
<li>If not, and the image only contains shades of gray, rgbgfx maps them to
|
|
the indices appropriate for each shade. Any undetermined indices are set
|
|
to respective default shades of gray. For example: if the bit depth is 2
|
|
and the image contains light gray and black, they become the second and
|
|
fourth colors, and the first and third colors get set to default white and
|
|
dark gray. If the image has multiple shades that map to the same index,
|
|
the palette is instead determined as if the image had color.</li>
|
|
<li>If the image has color (or the grayscale method failed), the colors are
|
|
sorted from lightest to darkest.</li>
|
|
</ul>
|
|
<p class="Pp">The input image may not contain more colors than the selected bit
|
|
depth allows. Transparent pixels are set to palette index 0.</p>
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="ARGUMENTS"><a class="permalink" href="#ARGUMENTS">ARGUMENTS</a></h1>
|
|
Note that options can be abbreviated as long as the abbreviation is unambiguous:
|
|
<code class="Fl">--verb</code> is
|
|
<code class="Fl">-</code> <code class="Fl">-verbose</code>, but
|
|
<code class="Fl">--ver</code> is invalid because it
|
|
could also be <code class="Fl">--version</code>. The
|
|
arguments are as follows:
|
|
<dl class="Bl-tag">
|
|
<dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a>
|
|
<var class="Ar">attrmap,</var>
|
|
<code class="Fl">--attr-map</code>
|
|
<var class="Ar">attrmap</var></dt>
|
|
<dd>Generate a file of tile mirroring attributes for OAM or (CGB-only)
|
|
background tiles. For each tile in the input file, a byte is written
|
|
representing the dimensions that the associated tile in the output file
|
|
should be mirrored. Useful in combination with <code class="Fl">-m</code>
|
|
to keep track the mirror direction of mirrored duplicate tiles.</dd>
|
|
<dt><a class="permalink" href="#A"><code class="Fl" id="A">-A</code></a>,
|
|
<code class="Fl">--output-attr-map</code></dt>
|
|
<dd>Same as <code class="Fl">-a</code>, but the attrmap file output name is
|
|
made by taking the input filename, removing the file extension, and
|
|
appending <span class="Pa">.attrmap</span>.</dd>
|
|
<dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a>,
|
|
<code class="Fl">--color-curve</code></dt>
|
|
<dd>Use the color curve of the Game Boy Color when generating palettes.</dd>
|
|
<dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a>,
|
|
<code class="Fl">--debug</code></dt>
|
|
<dd>Debug features are enabled.</dd>
|
|
<dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>
|
|
<var class="Ar">depth</var>,
|
|
<code class="Fl">--depth</code>
|
|
<var class="Ar">depth</var></dt>
|
|
<dd>The bit depth of the output image (either 1 or 2). By default, the bit
|
|
depth is 2 (two bits per pixel).</dd>
|
|
<dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a>,
|
|
<code class="Fl">--fix</code></dt>
|
|
<dd>Fix the input PNG file to be a correctly indexed image.</dd>
|
|
<dt><a class="permalink" href="#F"><code class="Fl" id="F">-F</code></a>,
|
|
<code class="Fl">--fix-and-save</code></dt>
|
|
<dd>Same as <code class="Fl">-f</code>, but additionally, the supplied command
|
|
line parameters are saved within the PNG and will be loaded and
|
|
automatically used next time.</dd>
|
|
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a>,
|
|
<code class="Fl">--horizontal</code></dt>
|
|
<dd>Lay out tiles horizontally rather than vertically.</dd>
|
|
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>,
|
|
<code class="Fl">--mirror-tiles</code></dt>
|
|
<dd>Truncate tiles by checking for tiles that are mirrored versions of others
|
|
and omitting these from the output file. Useful with tilemaps and attrmaps
|
|
together to keep track of the duplicated tiles and the dimension mirrored.
|
|
Tiles are checked for horizontal, vertical, and horizontal-vertical
|
|
mirroring. Implies <code class="Fl">-u</code>.</dd>
|
|
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
|
|
<var class="Ar">out_file</var>,
|
|
<code class="Fl">--output</code>
|
|
<var class="Ar">out_file</var></dt>
|
|
<dd>The name of the output file.</dd>
|
|
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
|
|
<var class="Ar">pal_file</var>,
|
|
<code class="Fl">--palette</code>
|
|
<var class="Ar">pal_file</var></dt>
|
|
<dd>Output the image's palette in standard GBC palette format: bytes (8 bytes
|
|
for two bits per pixel, 4 bytes for one bit per pixel) containing the
|
|
RGB15 values in little-endian byte order. If the palette contains too few
|
|
colors, the remaining entries are set to black.</dd>
|
|
<dt><a class="permalink" href="#P"><code class="Fl" id="P">-P</code></a>,
|
|
<code class="Fl">--output-palette</code></dt>
|
|
<dd>Same as <code class="Fl">-p</code>, but the palette file output name is
|
|
made by taking the input PNG file's filename, removing the file extension,
|
|
and appending <span class="Pa">.pal</span>.</dd>
|
|
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a>
|
|
<var class="Ar">tilemap</var>,
|
|
<code class="Fl">--tilemap</code>
|
|
<var class="Ar">tilemap</var></dt>
|
|
<dd>Generate a file of tile indices. For each tile in the input file, a byte
|
|
is written representing the index of the associated tile in the output
|
|
file. Useful in combination with <code class="Fl">-u</code> or
|
|
<code class="Fl">-m</code> to keep track of duplicate tiles.</dd>
|
|
<dt><a class="permalink" href="#T"><code class="Fl" id="T">-T</code></a>,
|
|
<code class="Fl">--output-tilemap</code></dt>
|
|
<dd>Same as <code class="Fl">-t</code>, but the tilemap file output name is
|
|
made by taking the input filename, removing the file extension, and
|
|
appending <span class="Pa">.tilemap</span>.</dd>
|
|
<dt><a class="permalink" href="#u"><code class="Fl" id="u">-u</code></a>,
|
|
<code class="Fl">--unique-tiles</code></dt>
|
|
<dd>Truncate tiles by checking for tiles that are exact duplicates of others
|
|
and omitting these from the output file. Useful with tilemaps to keep
|
|
track of the duplicated tiles.</dd>
|
|
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a>,
|
|
<code class="Fl">--version</code></dt>
|
|
<dd>Print the version of the program and exit.</dd>
|
|
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a>,
|
|
<code class="Fl">--verbose</code></dt>
|
|
<dd>Verbose. Print errors when the command line parameters and the parameters
|
|
in the PNG file don't match.</dd>
|
|
<dt><a class="permalink" href="#x"><code class="Fl" id="x">-x</code></a>
|
|
<var class="Ar">tiles</var>,
|
|
<code class="Fl">--trim-end</code>
|
|
<var class="Ar">tiles</var></dt>
|
|
<dd>Trim the end of the output file by this many tiles.</dd>
|
|
</dl>
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
|
|
The following will take a PNG file with a bit depth of 1, 2, or 8, and output
|
|
planar 2bpp data:
|
|
<p class="Pp"></p>
|
|
<div class="Bd Bd-indent">$ rgbgfx -o out.2bpp in.png</div>
|
|
<p class="Pp">The following creates a planar 2bpp file with only unique tiles,
|
|
and its tilemap <span class="Pa">out.tilemap</span>:</p>
|
|
<p class="Pp"></p>
|
|
<div class="Bd Bd-indent">$ rgbgfx -T -u -o out.2bpp in.png</div>
|
|
<p class="Pp">The following creates a planar 2bpp file with only unique tiles
|
|
<span class="Pa">accounting for tile mirroring</span> and its associated
|
|
tilemap <span class="Pa">out.tilemap</span> and attrmap
|
|
<span class="Pa">out.attrmap</span>:</p>
|
|
<p class="Pp"></p>
|
|
<div class="Bd Bd-indent">$ rgbgfx -A -T -m -o out.2bpp in.png</div>
|
|
<p class="Pp">The following will do nothing:</p>
|
|
<p class="Pp"></p>
|
|
<div class="Bd Bd-indent">$ rgbgfx in.png</div>
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
|
|
Please report bugs on
|
|
<a class="Lk" href="https://github.com/rednex/rgbds/issues">GitHub</a>.
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
|
ALSO</a></h1>
|
|
<a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>,
|
|
<a class="Xr" href="rgblink.1.html">rgblink(1)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>,
|
|
<a class="Xr" href="gbz80.7.html">gbz80(7)</a>
|
|
</section>
|
|
<section class="Sh">
|
|
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
|
<code class="Nm">rgbgfx</code> was created by <span class="An">stag019</span> to
|
|
be included in RGBDS. It is now maintained by a number of contributors at
|
|
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
|
|
</section>
|
|
</div>
|
|
<table class="foot">
|
|
<tr>
|
|
<td class="foot-date">December 5, 2019</td>
|
|
<td class="foot-os">General</td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|