Changes

Jump to: navigation, search

Img2CPC

184 bytes added, 18:32, 22 July 2015
[[Category:Stub]][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&nbsp;properly.  <br>
<pre>
Usage:
<br> Img2CPC [/w=width] [/h=height] [/g] [/bn=tileBaseName] [/m=mode] [/t] [/f] [/o=output] [/c=80] [/cbb] files
Img2CPC [/w=width] [/h=height] [/g] [/bn=tileBaseName] [/m=mode] [/t]&nbsp;[/f] [/o=output] [/c=80] [/cbb] files  <br>  *'''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) <br/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.
<br> There is a node in that file like this:
There is a node in&nbsp;that file like this:  <brpre>  &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.
<br> There is another node like this:
There is another&nbsp;node like this: <pre> <add key="TransparentColor" value="0"/> </pre>
<br> Which specifies the color that will be assumed as transparent (in this&nbsp;case, it will be the first color in the palette). This is only taken&nbsp;into account if you want to create sprites (tiles with masks) or&nbsp;precompiled sprites.
The color reduction is performed using a nearest color algorithm, so&ltnbsp;add key="TransparentColor" value="0"/&gt;  <br>  Which specifies the color that will be assumed original image can have as many colors as transparent 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 specify in the config file). The "g" switch can be useful to create sprites (tiles with masks) orcheck the&nbsp;precompiled spritescolor reduction results without having to use a CPC emulator.
<br> Latest versions of Img2CPC are included in the [[CPCtelera|'''CPCtelera game engine''']].
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)[http://www. The "g" switch can be useful to check the<br>color reduction results without having to use a CPC emulatoramstrad.es/forum/download/file.php?id=840 '''Download Img2CPC''']
34
edits