Changes

Jump to: navigation, search

Img2CPC

260 bytes added, 14:34, 13 July 2020
new category
[http://www.amstrad.es/forum/download/file.php?id=840 '''Img2CPC '''] is a command line tool, developed by AugustoRuiz using C#. You will need the .NET Framework 2.0 to run it<br>&nbsp;properly.
<pre>
Usage:
Img2CPC [/w=width] [/h=height] [/g] [/bn=tileBaseName] [/m=mode]
[/t] [/f] [/o=output] [/c=80] [/cbb] files
Usage:   Img2CPC [/w=width] [/h=height] [/g] [/bn=tileBaseName] [/m=mode] [/t]&nbsp;[/f] [/o=output] [/c=80] [/cbb] files   *'''w''': Tile Width. If not specified, it will process the&nbsp;whole image width.*'''h''': Tile Height. If not specified, it will process the&nbsp;whole image height.*'''g''': If specified, it will generate one bmp file per tile.*'''bn''': Base name to be used for asm labels.*'''m''': Pixel mode. Valid values are 0,1,2.&nbsp;If not specified defaults to mode 0.*'''t''': Transparency. Creates masks for transparent pixels.*'''i''': Interlace masks. Creates masks for transparent pixels, mixing them&nbsp;with sprite data.*'''f''': Flipped values LUT. Creates a look-up table with&nbsp;flipped bytes for the current mode.*'''o''': Output file name. Default value is gfx.h*'''c''': Create compiled sprites. Screen width in bytes can (should) be&nbsp;specified.&nbsp;(Default width is 80). File name will be compiled.[outputFileName]*'''cbb''': Create backcuffer compiled sprites. File name will be bb.compiled.[outputFileName]*'''files''': List of files to process. Wildcards can be used (*.png) </pre>
You can specify Img2CPC the palette you want to use. Depending on the&nbsp;mode specified, the program will reduce the number of colors of the&nbsp;original image to 16 colors (mode 0), 4 colors (mode 1) or 2 colors&nbsp;(mode 2). To change the palette that the program uses, you can modify&nbsp;the Img2CPC.exe.config file, which is a XML file.
There is a node in that file like this:
<pre> There is a node in&nbsp;that file like this:   &lt; <add key="PaletteColors"<br> value="244,0,244#0,0,132#0,132,132#0,244,132#132,0,0#132,132,0#132,244,0# 132,0,132#132,132,132#132,244,132#0,0,0#244,132,0#244,244,0# 244,132,244#132,132,244#244,244,244"/> </pre>
<br>Please, do not change the key, just the value. The value of this node&nbsp;represents the palette colors in RGB, using commas to separate the&nbsp;color components, and a sharp to separate the colors.
There is another node like this:
<pre>
<add key="TransparentColor" value="0"/>
</pre>
There is anotherWhich specifies the color that will be assumed as transparent (in this&nbsp;node like this:   case, it will be the first color in the palette). This is only taken&ltnbsp;add key="TransparentColor" value="0"/into account if you want to create sprites (tiles with masks) or&gtnbspprecompiled sprites.
Which specifies the The color that will be assumed reduction is performed using a nearest color algorithm, so&nbsp;the original image can have as transparent many colors as you want (in thisalthough you&nbsp;case, it will be get better results if the first color in original image has the same palette). This is only takenyou&nbsp;into account if you want to create sprites (tiles with masksspecify in the config file) or. The "g" switch can be useful to check the&nbsp;precompiled spritescolor reduction results without having to use a CPC emulator.
Latest versions of Img2CPC are included in the [[CPCtelera|'''CPCtelera game engine''']].
[http://www.amstrad.es/forum/download/file.php?id=840 '''Download Img2CPC''']
The color reduction is performed using a nearest color algorithm, so&nbsp;the original image can have as many colors as you want (although you&nbsp;will get better results if the original image has the same palette you&nbsp;<br>specify in the config file). The "g" switch can be useful to check the<br>color reduction results without having to use a CPC emulator.[[Category:CrossDev]]
953
edits