You are here

Respace Tiles

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!
AttachmentSize
respace-tiles.scm7.48 KB

 

This Script-fu scripts could help with certain tileset manipulations. Specifically changing margin and spacing.

  • Add spacing and margin - Will add spacing and margin to a tileset which has no spacing and no margin.
  • Remove spacing and margin - The opposite of Add.
  • Fill spaces - After spacing-margin is added the new space has background color. This script can be used to fill the space by copying some columns and rows (border of tiles):

 

 

Installation steps

  1. Unzip and copy the file respace-tiles.scm to Gimp script directory (Goto edit/preferences/Directories/Scripts to find the right location)
  2. Reload scripts by Filters/Script-Fu/Refresh Scripts or just restart Gimp)

Plugins are registered under Filtres/Map/Tileset.

 

 

Example

Say I have a tileset with tile size 64x64, margin 1 and spacing 2 and I want scale it down to 32x32 with the same margin and spacing. I can't just scaled the whole image as there are two problems with that:

  • Spacing and margin will be also scaled so spacing will be 1 and margin even half pixel.
  • Borders of tiles will be slightly changed because of interpolation (they will get flavor of neighbor tiles or background color)

So instead I usually do the following steps:

  1. Remove margin/spacing.
  2. Add margin 8 and spacing 8. Note: When increasing spacing and/or margin, increase also layer size otherwise the bottom and right tiles might get cropped. It is also good idea to have even number image size.
  3. Invoke Fill spaces with Tile size=64, margin=8 spacing=8 Copy distance 1. This will create frame around each tile.
  4. Again Fill spaces but this time Tile size=66 margin=7 spacing=6 and with Copy distance 1 (2 or 3 will also do the job). This will create another (bigger) frame.
  5. Scale down 2x and move the scaled layer back to top left corner. Now the Tile size=32x32 margin=4 spacing=4
  6. Invoke Remove spacing and margin. Tiles are half size now and still seamless.
  7. Now I can add required spacing=2 and margin=1 and then fill spaces.
Code License: 
GIMP Version: 
Scripting Engine: 
Subscribe to Comments for "Respace Tiles"