Giter VIP home page Giter VIP logo

gimp-tilemap-helper's Introduction

Tilemap Helper: Gimp Plug-in for Optimizing Tile Maps and Tile Sets

NOTE: The current version is rough around the edges. It needs improvement and refactoring of the source. That may come in time. For now, consider it a mostly working beta...

A GIMP plugin to help with creating tile maps and tile sets for games.

You can create a level map in Gimp (or other image editors) and use this plugin to help with tile de-duplication and tile set optimizing.

This plugin is not meant to replace tile set and map editors. Instead it aims to provide quick, in-workflow feedback without having to leave GIMP to analyze tiles in another application.

Download compiled executables here:

Plugin showing tile map helper with an image open

Features

  • Optional Tile deduplication
  • Overlay of Tile ID # on source image
  • Click-to-highlight matching tiles on source image
  • Estimates of memory usage for storing Tile Set and Map
  • Use either Source Layer or Entire Image
  • Variable Tile size
  • Tile X/Y Flipping detection
  • Export Tile Set as image -> new GIMP image
  • Export Tile Map as text -> Clipboard (C array, RGBDS ASM)
  • Works with indexed and 24 bit RGB images (including alpha masks)

OS binaries available for:

  • Linux (GIMP 2.8+)
  • Windows (GIMP 2.10.12+)

Usage:

  • The plugin is located under: Main Menu -> Filters -> Map -> Tilemap Helper

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 "plugin-gimp-tilemap-helper" 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:

Known limitations & Issues:

  • Max number of tiles: 8096
  • The Source Image or Layer must be an exact multiple of tile size in both dimensions
  • Greyscale images are not yet supported. Convert to RGB or indexed first
  • Map export prefix labels are saved to images as GimpParasites, so only persist across sessions when images are saved in GIMP's native XCF format

GIMP usage hints:

gimp-tilemap-helper'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

Watchers

 avatar  avatar

gimp-tilemap-helper's Issues

Segmentation fault on mid-size images and when increasing zoom level

Environment:
Linux 3.16.0-6-amd64
Gimp 2.8.14
GCC 4.9.2
libgtk 2.24.25

Sample image:
test

Issue:
Opening Tilemap helper from Gimp's filters menu with the above image or any other with the same or bigger dimensions causes tilemap-helper to segfault.
Also, with smaller images (IE the above image cropped down to a 80x80 block), increasing the zoom level inside Tilemap Helper window's above 2 triggers the issue too.
Might this be related to GTK?

Here's the console output:

================================= Filter Main: run mode=0  image_id = 1   ================================= 

Scale: Invalidated
Tilemap: recalc invalidated
Overlay: invalidated
Process: Start --> tilemap recalc = 1, scale = 2
Source Image: Loading (flattened=1)...
Source Image: ... Loading Completed
Dialog: Check Window Resize...(-1/320) (-1/288)  Resize = YES  (applied, queueing another redraw pass...)
Process: Start --> tilemap recalc = 1, scale = 2
Dialog: Check Window Resize...(320/320) (288/288)  Resize = NO
Scale: Check Realloc : (0/4) (0/320) (0/288) (0/2) (0/0)..  Reallocated. Valid (scaled image) -> to 0 (false)
Scale: Check Reapply -> *Required = YES* : scale cached/new (2/2), valid=0
Scale: Check Reapply -> *Required = YES* : scale cached/new (2/2), valid=0
Scale: Scaling image now: 2x, bpp=4, valid image = 0
/home/nokia64/.gimp-2.8/plug-ins/plugin-gimp-tilemap-helper: fatal error: Segmentation fault
Scale: Start -> RGBA

Feel free to ask for any other sort of debugging information that could be of help.
Thanks.

Select and place tiles on the map inside the plugin screen

(via Indecom ~ GBStudio)

Add the option to copy tiles from one location on the Tile Map to another.
It could be:

  • Shift + Right Click to select
  • Shift + Left Left Down to paint as mouse moves
  • Maybe modifiers (Alt, Ctrl?) flipped the painted tile on X and/or Y axis

Would need to add the ability to write the updated layer back out, replacing the contents of the existing layer. That's a little involved since currently:

  • Makes a copy of the source image -> merges all layers -> converts everything to 24/32bit RGB -> uses that to show and calculate the map.

  • If it was limited to images that only had one layer, or to just writing the output to a new image then it would be easier to implement.

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.