GithubHelp home page GithubHelp logo

bbbbbr / gimp-tilemap-gb Goto Github PK

View Code? Open in Web Editor NEW
62.0 2.0 5.0 3.66 MB

Tilemap GB - Console App - AND - GIMP plugin for importing & exporting Game Boy game tilemaps and tilesets (as bitmap images or .GBM/.GBR files. Related tools: GBTD, GBMB, GBDK, Zal0-ZGB)

License: GNU General Public License v3.0

Makefile 0.67% C 88.05% C++ 11.28%
gameboy tilemap tiled-map-editor tilesets gimp gimp-plugin game-tools gbtd gbmb

gimp-tilemap-gb's Introduction

Tilemap GB (Gimp Plugin and command line tool): tilemap generator and exporter for Game Boy / Game Boy Color / GBDK & ZGB

There are two versions of the tool:

Standalone, command line version: png2gbtiles

GIMP plugin for importing & exporting Game Boy game tilemaps and tilesets.

You can create a level map in Gimp (or other image editors) then export it to either C Source files for the GBDK, or export as .gbr / .gbm for editing and further work in either GBTD or GBMB. You can also import from .gbr and .gbm files, and re-export to them (tile order may change and not all app prefs may survive the import/re-export trip).

(Also see Zal0's command line converters from GBR/GBM -> .c/.h.)

*This plugin is functional, but not polished. Don't be surprised to find some rough edges or annoyances.

Download compiled GIMP Plugin executables here:

Download compiled Console executables here:

Or check Releases

Opening a Game Boy Map Builder map as an image in GIMP

Features (DMG & CGB)

  • Tile deduplication (same colors/same pattern)
  • Optional remapping of colors to a specific palette (user supplied palette or to repair per-tile color limit errors with the images current palette)

CGB only features

  • Flipped X/Y tile deduplication
  • Alternate Palette tile deduplication

Tile Map export formats:

Tile Set export formats:

Tile Set & Map import formats:

  • GBR
  • GBM

Color Gameboy Support (CGB):

  • Import & Export

Supported formats:

  • GB 2bpp
  • CGB Color mode

Settings:

  • The plug-in will attempt to preserve Tile & Map Export settings across import and later export (they get attached to the native GIMP XCF image as a Parasite that persists accross save/load).
  • Option to ignore CGB per-tile palette violation errors. The tile will still be forced to 4 colors and it will use the first palette found in the tile.

Usage / Cautions:

  • Work on an 8x8 grid. It will save you time, trouble and ROM size later on.
  • Available tile sizes are: 8x8, 8x16, 16x16, 32x32
  • The source image should be an even multiple of the tile size.
  • While C Source / GBM Maps can export to all tile sizes, working with 8x8 is sometimes most practical for hardware (unless set up for meta-tiles).
  • Exported GBR should have no more than 4 colors (DMG) or 32 colors (CGB)
  • In CGB mode the 32 color palette is broken up into 8 separate, consecutive sub-palettes of 4 colors each
  • When exporting in CGB mode, tiles should not use colors from more than one sub-palette at a time. Export will fail if they do, unless one of the following is enabled:
    • "Ignore CGB Palette Errors"
    • "Try to Repair Palette Errors" are enabled.
  • The only metadata preserved across import and later re-export for GBR / GBM files are the Tile/Map Export Settings. Other data such as recently used files, etc are not currently preserved when exporting back out. (Maybe later).
  • If you export using this path: GIMP -> GBTD or GBMB -> C source, then you'll need to set up the export options for GBTD (path, tiles to export, etc) and GBMB (path, location format, etc). Some, but not all, of them will be pre-populated.

Quick instructions:

Native compile/install on Linux using below.

If GIMP & build tools not yet installed:
(example for debian/ubuntu/mint)
 * sudo apt install gimp
 * sudo apt install build-essential
 * sudo apt install libgimp2.0-dev

Then:
* cd gimp-rom-bin
* make

Then copy the resulting "file-tilemap" to your GIMP plugin folder, depends on version

Plug-in folder locations:
 Linux: ~/.gimp-2.8/plug-ins  , or ~/.config/GIMP/2.10/plug-ins
 Windows: C:\Program Files\GIMP 2\lib\gimp\2.0\plug-ins

Guide for Cross-compiling to Windows on Linux

Requirements:

  • Image must be indexed color and not have more colors than output format supports, unless one of the following is enabled:
    • "Ignore CGB Palette Errors"
    • "Remap/Repair Palette Errors" and "Remap using a Palette File".

Known limitations & Issues:

  • GBMB Export only populates the Export Location Format if it was present on a preceding Import. Otherwise it must be done manually.
  • When a GBMB Map is imported (along with matching GBTD Tileset), any tiles not used on the map will get discarded on re-export.
  • Tile set ordering may change on export if the GBMB Map changes (tile set order is based on the when a given tiles is first encountered while scanning left -> right, top -> bottom)

gimp-tilemap-gb's People

Contributors

bbbbbr 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gimp-tilemap-gb's Issues

gbdk c?

Hi

From gifhub
"You can create a level map in Gimp (or other image editors) then export it to either C Source files for the GBDK, or export as .gbr / .gbm for editing and further work in either GBTD or GBMB."

Where is the C export? I don't find it in gimp...

-csource output not working for console version (png2gbtiles)

$ png2gbtiles dungeon_map.gbm.png -gbm output
Loading image from file: dungeon_map.gbm.png
Writing output to file: output
gbm export: 128 x 128 with mode = 0, dedupe tile pattern = 1, dedupe flip = 0, dedupe pal = 0, ignore pal error = 0
gbm output: total tiles = 48
gbr output: source image: 8 x 384, tile size:8 x 8, tile count: 48
gbm->gbr tileset export: status= 1, to:output.tiles.gbr
gbm output to map: 16x16 @ size=256

$ png2gbtiles dungeon_map.gbm.png -csource output
Loading image from file: dungeon_map.gbm.png
Writing output to file: output
Error: Tile count exceeded limitError: Tile count exceeded limit

CGB Export

Ability to export in CGB mode would be useful.

  • Preserve palette if one exists from previous import
  • TBD: How tile-set tile palette vs per-map palette override is chosen and handled

Improve default export settings for GBR/GBM files

The following should get useful auto-defaults based on the content of the exported Tile Map and Tile Set.

  • gbr.tile_export
  • gbm.map_export_prop

GBR output should include:

  • output filename: _tiles.c
  • type: GBDK C File
  • label: _tiles
  • from/upto: 0 ..
  • format: gameboy 4 color
  • counter: none
  • export tiles as one unit: true
  • gb compress: false
  • include: palette colors: true

GBM output should include:

  • output filename: _map.c
  • type: GBDK C File
  • label: _map
  • Location format: DMG: Tile Number @ 8 bits, CGB: + GBC BG Attribute @ 8 bits
  • map layout: rows
  • plane count: DMG: 1 plane (8 bits) CGB: 2 planes (16 bits)
  • plane order: planes are continues
  • tile offset: 0

Problem with palette 4 colors.

Hello, when i open the placeholder file i found in gb-studio .
I see only 4color ,but the plugin export gbm say that i have 5 colors.
The export in .c seem to work correctly .
But when i want to compile with gbdk-2020 i have some errors.

`main.c:309: syntax error: token -> 'guint' ; column 7
main.c:310: error 1: Syntax error, declaration ignored at 'guint'
main.c:311: error 1: Syntax error, declaration ignored at 'guint'
main.c:312: error 1: Syntax error, declaration ignored at 'guint8'
make: *** [Makefile:29 : Example.gb] Erreur 1

the line in my file.c

guint width;
guint height;
guint bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
guint8 pixel_data[160 * 144 * 3 + 1];

Thanks for your help

Installing error in windows

Hi.
I talk to you at gbdev forums I was going to test the plugin but I could not install it.
It shows an error about not finding libcairo-2.dll (the file is there).
I had to replace that file, and even then the plugin refused to work, a lot of missing dll's and stuff.

Thanks.

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.