Home

Awesome

Gfx2Next

ZX Spectrum Next graphics conversion tool.

Converts an uncompressed 8-bit BMP,PNG or ASEPRITE file to the Sinclair ZX Spectrum Next graphics format(s).

Supported Formats

Usage

gfx2next [options] <srcfile> [<dstfile>]

Options

ParameterDescription
-debugOutput additional debug information
-fontSets output to Next font format (.spr)
-screenSets output to Spectrum screen format (.scr)
-screen-noattribsRemove color attributes
-bitmapSets output to Next bitmap mode (.nxi)
-bitmap-yGet bitmap in Y order first. (Default is X order first)
-bitmap-size=XxYSplits up the bitmap output file into X x Y sections
-spritesSets output to Next sprite mode (.spr)
-frame=nSet frame n for Aseprite
-tiles-file=<filename>Load tiles from file in .nxt format
-tile-size=XxYSets tile size to X x Y
-tile-norepeatRemove repeating tiles
-tile-nomirrorRemove repeating and mirrored tiles
-tile-norotateRemove repeating, rotating and mirrored tiles
-tile-yGet tile in Y order first. (Default is X order first)
-tile-ldwsGet tile in Y order first for ldws instruction. (Default is X order first)
-tile-offset=nSets the starting tile offset to n tiles
-tile-offset-autoAdds tile offset when using wildcards
-tile-pal=nSets the palette offset attribute to n
-tile-pal-autoIncrements palette offset when using wildcards
-tile-noneDon't save a tile file
-tile-planar4Output tiles in planar (4 planes) rather than chunky format
-tiledProcess file(s) in .tmx format
-tiled-tsxOutputs the tileset data as a separate .tsx file
-tiled-file=<filename>Load map from file in .tmx format
-tiled-blank=nSet the tile id of the blank tile
-tiled-outputOutputs tileset .png and map data to Tiled .tmx format
-tiled-width=nSets Tiled tileset width output in pixels (default is 256)
-block-size=XxYSets blocks size to X x Y for blocks of tiles
-block-size=nSets blocks size to n bytes for blocks of tiles
-block-norepeatRemove repeating blocks
-block-16bitGet blocks as 16 bit index for < 256 blocks
-map-noneDon't save a map file (e.g. if you're just adding to tiles)
-map-16bitSave map as 16 bit output
-map-ySave map in Y order first. (Default is X order first)
-map-smsSave 16-bit map with Sega Master System attribute format
-bank-8kSplits up output file into multiple 8k files
-bank-16kSplits up output file into multiple 16k files
-bank-48kSplits up output file into multiple 48k files
-bank-size=nSplits up output file into multiple n byte size files
-bank-sections=name,..Section names for asm files
-color-distanceUse the shortest distance between color values (default)
-color-floorRound down the color values to the nearest integer
-color-ceilRound up the color values to the nearest integer
-color-roundRound the color values to the nearest integer
-colors-4bitUse 4 bits per pixel (16 colors). Default is 8 bits per pixel (256 colors). Get sprites or tiles as 16 colors, top 4 bits of 16 bit map is palette index
-colors-1bitUse 1 bit per pixel (2 colors). Default is 8 bits per pixel (256 colors)
-pal-file=<filename>Load palette from file in .nxp format
-pal-embedThe raw palette is prepended to the raw image file
-pal-extThe raw palette is written to an external file (.nxp). This is the default
-pal-minIf specified, minimize the palette by removing any duplicated colors, sort it in ascending order, and clear any unused palette entries at the end. This option is ignored if the -pal-std option is given
-pal-fullGenerate the full palette for -colors-4bit mode
-pal-stdIf specified, convert to the Spectrum Next standard palette colors. This option is ignored if the -colors-4bit option is given
-pal-noneNo raw palette is created
-pal-rgb332Output palette in RGB332 (8-bit) format
-pal-bgr222Output palette in BGR222 (8-bit) format. Bits 7-6 are unused
-pal-zxOutput a ZX Spectrum attribute block for input image
-pal-zx-defaultAttribute value to use if only 1 color is detected in attribute
-zx0Compress all data using zx0
-zx0-screenCompress screen data using zx0
-zx0-bitmapCompress bitmap data using zx0
-zx0-spritesCompress sprite data using zx0
-zx0-tilesCompress tile data using zx0
-zx0-blocksCompress block data using zx0
-zx0-mapCompress map data using zx0
-zx0-paletteCompress palette data using zx0
-zx0-backSet zx0 to reverse compression mode
-zx0-quickSet zx0 to quick compression mode
-asm-z80asmGenerate header and asm binary include files (in Z80ASM format)
-asm-sjasmGenerate asm binary incbin file (SjASM format)
-asm-file=<name>Append asm and header output to <name>.asm and <name>.h
-asm-startSpecifies the start of the asm and header data for appending
-asm-start-autoSets start parameter for first item when using wildcards
-asm-endSpecifies the end of the asm and header data for appending
-asm-end-autoSets end parameter for first item when using wildcards
-asm-sequenceAdd sequence section for multi-bank spanning data
-previewGenerate png preview file(s)

Examples

Source code

https://github.com/headkaze/Gfx2Next

Compiling

gcc -O2 -Wall -o bin/gfx2next src/lodepng.c src/zx0.c src/gfx2next.c -lm

Credits

Download

Gfx2Next