GithubHelp home page GithubHelp logo

wonderfultoolchain / superfamiconv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from optiroc/superfamiconv

1.0 0.0 0.0 1.05 MB

Flexible and composable tile graphics converter supporting Super Nintendo, Game Boy, Game Boy Color, Game Boy Advance, Mega Drive, PC Engine and WonderSwan formats.

License: MIT License

Makefile 0.09% C++ 97.94% CMake 0.09% C 1.87%

superfamiconv's Introduction

superfamiconv

A tile graphics converter with flexible and composable command line options.

Developed by David Lindecrantz and distributed under the terms of the MIT license.

dependencies

A C++14 capable compiler.

building

In a Unix-like environment simply make the binary. On Windows use CMake to generate a build environment.

operation

superfamiconv <command> [<options>]

Where <command> is either palette, tiles, map or left blank for a simpler "short hand" operation.

In short hand mode, the following options are available:

-i --in-image         Input: image
-p --out-palette      Output: palette data
-t --out-tiles        Output: tile data
-m --out-map          Output: map data
--out-palette-image   Output: palette image
--out-palette-act     Output: photoshop palette
--out-tiles-image     Output: tiles image
--out-scaled-image    Output: image scaled to destination colorspace

-M --mode             Mode <default: snes>
-B --bpp              Bits per pixel
-W --tile-width       Tile width
-H --tile-height      Tile height
-R --no-remap         Don't remap colors <switch>
-D --no-discard       Don't discard redundant tiles <switch>
-F --no-flip          Don't discard using tile flipping <switch>
-T --tile-base-offset Tile base offset for map data
-S --sprite-mode      Apply sprite output settings <switch>
--color-zero          Set color #0

-v --verbose          Verbose logging <switch>
-l --license          Show licenses <switch>
-h --help             Show this help <switch>

This command mode accepts one image (either indexed, RGB or RGBA mode PNG โ€“ which are the formats supported for all image inputs) and outputs palette, tile and/or map data.

The mode option, which is common for all commands, affects the color space handling and binary output format. It takes one of the following arguments:

  • snes
  • snes_mode7
  • gb
  • gbc
  • gba
  • gba_affine
  • md
  • pce
  • pce_sprite
  • ws
  • wsc
  • wsc_packed

Sensible default options are applied, and differ depending on selected mode.

Example:

superfamiconv -v --in-image snes.png --out-palette snes.palette --out-tiles snes.tiles --out-map snes.map --out-tiles-image tiles.png
Loaded image from "snes.png" (256x224px, indexed color)
Mapping optimized palette (16x16 entries)
Setting color zero to #505050
Created palette with 24 colors [16,8]
Created optimized tileset with 156 entries (discarded 740 redudant tiles)
Mapping 896 8x8px tiles from image
Saved native palette data to "snes.palette"
Saved native tile data to "snes.tiles"
Saved native map data to "snes.map"
Saved tileset image to "tiles.png"

For more flexibility use the sub commands, which have the following options respectively:

superfamiconv palette

Usage: superfamiconv palette [<options>]
  -i --in-image             Input: image
  -d --out-data             Output: native data
  -a --out-act              Output: photoshop palette
  -j --out-json             Output: json
  -o --out-image            Output: image

Settings:
  -M --mode                 Mode <default: snes>
  -P --palettes             Number of subpalettes
  -C --colors               Colors per subpalette
  -W --tile-width           Tile width
  -H --tile-height          Tile height
  -R --no-remap             Don't remap colors <switch>
  -S --sprite-mode          Apply sprite output settings <switch>
  -0 --color-zero           Set color #0

  -v --verbose              Verbose logging <switch>
  -h --help                 Show this help <switch>

superfamiconv tiles

Usage: superfamiconv tiles [<options>]
  -i --in-image             Input: image
  -n --in-data              Input: native data
  -p --in-palette           Input: palette (native/json)
  -d --out-data             Output: native data
  -o --out-image            Output: image

Settings:
  -M --mode                 Mode <default: snes>
  -B --bpp                  Bits per pixel
  -W --tile-width           Tile width
  -H --tile-height          Tile height
  -R --no-remap             Don't remap colors <switch>
  -D --no-discard           Don't discard redundant tiles <switch>
  -F --no-flip              Don't discard using tile flipping <switch>
  -S --sprite-mode          Apply sprite output settings <switch>
  -T --max-tiles            Maximum number of tiles

  -v --verbose              Verbose logging <switch>
  -h --help                 Show this help <switch>

superfamiconv map

Usage: superfamiconv map [<options>]
  -i --in-image             Input: image
  -p --in-palette           Input: palette (json/native)
  -t --in-tiles             Input: tiles (native)
  -d --out-data             Output: native data
  -j --out-json             Output: json
  -7 --out-m7-data          Output: interleaved map/tile data (snes_mode7)
  --out-gbc-bank            Output: banked map data (gbc)

Settings:
  -M --mode                 Mode <default: snes>
  -B --bpp                  Bits per pixel
  -W --tile-width           Tile width
  -H --tile-height          Tile height
  -F --no-flip              Don't use flipped tiles <switch>
  -T --tile-base-offset     Tile base offset for map data
  -P --palette-base-offset  Palette base offset for map data
  --map-width               Map width (in tiles)
  --map-height              Map height (in tiles)
  --split-width             Split output into columns of <tiles> width
  --split-height            Split output into rows of <tiles> height
  --column-order            Output data in column-major order <switch>

  -v --verbose              Verbose logging <switch>
  -h --help                 Show this help <switch>

future work

  • Better error diagnostics
  • Better documentation and example usage

acknowledgments

superfamiconv uses the following libraries:

superfamiconv's People

Contributors

arm9 avatar asiekierka avatar basxto avatar devinacker avatar issotm avatar lubosz avatar optiroc avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.