Game Box Creation - GIMP PythonFu Scripts

From BOARD18 Project WIKI
Revision as of 10:21, 27 June 2020 by Rich (talk | contribs) (added Tile Type Conversion Scripts and made other adjustments)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Game Box Creation edit


There are a number of GIMP PythonFu scripts for creating and modifying tile and token graphics. They can be found in the gimpPythonScripts directory of the board18 repository.

The GIMP PythonFu scripts can be installed in the gimp image editor by performing the following steps:

  1. In the GIMP image editor, use Edit, Preferences, Folders->Plug-ins to find location of plug-ins on your system. You'll see two directories. Do not use the system directory. Instead use your personal plug-ins directory. It should look something like /home/rich/.gimp-2.8/plug-ins [1]
  2. Copy the contents of the gimpPythonScripts directory from the BOARD18 repository into this directory.
  3. Make each of the copied files executable: chmod +x ~/.gimp-2.X/plug-ins/FILENAME.py
  4. Restart the GIMP image editor.
  5. The Python scripts will appear in the Filters->BD18 menu of the GIMP image editor.

The GIMP PythonFu scripts have been grouped into 3 sections. The first section contains scripts for type F tiles. The second section contains scripts for type P tiles. And the third section contains scripts for tokens. See this Design Document section for a description of the tile types mentioned here.

Footnotes:

  1. If you click on the word "Folders" you get only the "Temporary" and "Swap" folders, but if you click on the small icon at the very left of the word "Folders" you get the expansion with the correct choices.



Scripts For Type F Tiles

The Tile F Adjust Script

For example, to reformat a Blackwater Station tile to Type F:
1. Find the tile in the Blackwater Station Tile Encyclopedia.
2. Right click on tile and select "Copy Image".
3. Open gimp.
4. Select "Edit" - "Paste As" - "New Image".
5. Select "Filters" - "BD18" - "Tile-F-Adjust".

This script will adjust the scale of a type F tile image.
It will scale the image to 116x100 pix. All extra white space will be clipped by the script and the background will be made transparent.

The tile to be adjusted should be the only graphic data on the image. Remove any surrounding text before adjusting tile.

The New Tile F Sheet Script

This script will prompt for the number of columns in the new type F tile sheet.

It will then create a new tile sheet with room for the desired number of columns.

AddF.png

The Add Tile F To Sheet Script

As you can see, this script will prompt for three parameters:

  • "Tile to Add" The fully qualified name of the tile image file.
  • "Column" The tile sheet column to fill [numbered from one].
  • "Row Count" The number of rows to fill for that tile.

It will then create a column of tiles on the tile sheet.
Each tile in the column will be rotated 60 degrees clockwise compared to the tile above it.
The tile sheet produced by this script will conform to the following control parameters:

    "xStart":20, 
    "xSize":116, 
    "xStep":130, 
    "yStart":20, 
    "ySize":100, 
    "yStep":120,  

Scripts For Type P Tiles

The Tile P Adjust Script

This script will adjust the scale of a type P tile image.
It will scale the image to 100x116 pix. All extra white space will be clipped by the script and the background will be made transparent.

The tile to be adjusted should be the only graphic data on the image. Remove any surrounding text before adjusting tile.

The New Tile P Sheet Script

This script will prompt for the number of columns in the new tile sheet.

It will then create a new tile sheet with room for the desired number of columns.

AddP.png

The Add Tile P To Sheet Script

As you can see, this script will prompt for three parameters:

  • "Tile to Add" The fully qualified name of the tile image file.
  • "Column" The tile sheet column to fill [numbered from one].
  • "Row Count" The number of rows to fill for that tile.

It will then create a column of tiles on the tile sheet.
Each tile in the column will be rotated 60 degrees clockwise compared to the tile above it.

The tile sheet produced by this script will conform to the following control parameters:

    "xStart":20, 
    "xSize":100, 
    "xStep":120, 
    "yStart":20, 
    "ySize":116, 
    "yStep":130,  

Tile Type Conversion Scripts

The Tile F to P Convert Script

This script will adjust the scale and orientation of a type F tile image to create a type P image.
First it will rotate image by 30 degrees then it will scale it to 100x116 pix. All extra white space will be clipped by the script.

The tile to be adjusted should be the only graphic data on the image. Remove any surrounding text before adjusting tile.

The Tile P to F Convert Script

This script will adjust the scale and orientation of a type P tile image to create a type F image.
First it will rotate image by 30 degrees then it will scale it to 116x100 pix. All extra white space will be clipped by the script.

The tile to be adjusted should be the only graphic data on the image. Remove any surrounding text before adjusting tile.

Scripts For Tokens

The Token Adjust Script

This script will adjust the scale of a token image.
It will scale it to 30 pix. All extra white space will be clipped by the script.

The token to be adjusted should be the only graphic data on the image. Remove any surrounding text before adjusting token.

The New Token Sheet Script

This script will create a new token sheet for standard 30X30 Pix tokens.

It will prompt for the number of rows and columns in the new token sheet.

It will then create a new token sheet with room for the desired number of rows and columns.

The New Token Sheet X Script

This is an eXpanded version of the previous script which allows for non standard sized tokens.

It will prompt for the number of rows and columns in the new token sheet and also for the maximum hight and width of the largest tokens.

It will then create a new token sheet with room for the desired number of rows and columns.

The Add Token To Sheet Script

This script will add a token to a sheet of standard 30X30 Pix tokens.
This script should only be used to add tokens to a sheet created by the New Token Sheet script.

It will prompt for three parameters:

  • "Token to Add" The fully qualified name of the token image file.
  • "Column" The token sheet column to fill [numbered as one or two].
  • "Row" The token sheet row to fill [numbered from one].

It will then place a token on the token sheet.
The tokens will be spaced 10 pixels apart.

The Add Token X To Sheet Script

This is an eXpanded version of the previous script which allows for non standard sized tokens.
This script should only be used to add tokens to a sheet created by the New Token Sheet X script.

It will prompt for five parameters:

  • "Token to Add" The fully qualified name of the token image file.
  • "Column" The token sheet column to fill [numbered as one or two].
  • "Row" The token sheet row to fill [numbered from one].
  • "Width" The width in pix of the widest token that will be placed on the sheet.
  • "Height" The height in pix of the tallest token that will be placed on the sheet.

It will then place a token on the token sheet.
The token will be centered in the provided area.
The provided areas will be spaced 10 pixels apart.

The Batch Token Invert L Script

This script converts all the tokens in the input directory to grey scale tokens and writes each converted token to the output directory. This is the Linux version of this script.

It will prompt for four parameters:

  • "Input image" Do not enter anything in this field.
  • "Input drawable" Do not enter anything in this field.
  • "Input directory" Directory containing ping images of tokens to be converted to greyscale.
  • "Output directory" Empty directory.

Note: The input directory should not contain any greyscale images.

The Batch Token Invert W Script

This script converts all the tokens in the input directory to grey scale tokens and writes each converted token to the output directory. This is the Windows version of this script.

It will prompt for four parameters:

  • "Input image" Do not enter anything in this field.
  • "Input drawable" Do not enter anything in this field.
  • "Input directory" Directory containing ping images of tokens to be converted to greyscale.
  • "Output directory" Empty directory.

Note: The input directory should not contain any greyscale images.