GithubHelp home page GithubHelp logo

pictotile's Introduction

pictotile

Simple tool for converting images to gameboy tile data.

Installation

Ensure the golang toolchain is installed on your machine, then run from the repository root:

$ go build pictotile.go

This produces a self-contained binary and should be able to be placed and run anywhere.

Note that there are binaries in the Snapshots directory. These are outdated due to problems with the cross compiler. The binary in the root directory is current and built for linux, amd_64. Building for yourself is always preferable, and should always work.

Usage

pictotile [options] [infile [outfile]]

Inputs

Pictotile accepts png, jpeg and gif (not animated) file formats.

Input and output default to stdin/stdout, which can be set explicitly using "-" for either argument, otherwise the program can both read from and write to files.

Options

Note: Values shown below are defaults, description is for modifying the value.

-d, --dim=1: Square dimension in number tiles of each sprite

-w, --width=1: Width of each sprite in number of tiles

-h, --height=1: Height of each tile in number of tiles

-o, --offset=0: Offset of the first tile from both the top and left edge

-x, --xoffset=0: Horizontal offset of first tile from left

-y, --yoffset=0: Vertical offset of first tile from top

-s, --spacing=0: Distance between sprites

-X, --xspacing=0: Horizontal distance between sprites

-Y, --yspacing=0: Vertical distance between sprites

-f, --format="0x%X, ": C Style format for output data (printed in a loop for each byte)

-t, --spritemode=false: Sets first color in tile as transparency (color 0)

Description

Pictotile converts image files into gameboy compatible format. Default format prints each byte in the format "0xFF, ", but format can be specified using -f.

Tile data is output in a left-right, top-bottom order, however, tiles within a sprite are all output one after another.

For example, the command

pictotile -d2 img.png img.tile

will put the following set of tiles:

img.png:
+-+-+-+-+
|0|1|2|3|
+-+-+-+-+
|4|5|6|7|
+-+-+-+-+

in the following order:

img.tile:
0145 2367

pictotile's People

Contributors

brisk0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pictotile's Issues

Predefined palettes

Users should have the option to input a set of predefined palettes, likely in JSON format.

Change Palette Treatment

Palettes for an image should be stored globally in the program, and a tile checked for use of existing palettes before creating a new one in order to use existing palettes in cases such as tiles not using all colors etc.

This may require some sort of look-ahead in order to determine palette colors where the first tile uses less than 4 colors, or this may be left to the user to introduce palette tiles etc.

Palette Map

Program should have the ability to output an indexed palette map (and palettes used), so palettes can be easily assigned to large tile maps.

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.