Skip to main content

Tileset creator for GNOME Mahjongg

Project description

makemahjongg

v0.1.0
©2023 Jonas Santoso

Tileset creator for GNOME Mahjongg

Install

pip install makemahjongg

Usage

Given a directory containing 41 images, makemahjongg creates a tileset from them that can be used with GNOME Mahjongg. The tileset is based on the blank tile from GNOME Mahjongg's smooth theme.

Usage: makemahjongg source_directory output_file

The output file is a PNG which may be copied to Mahjongg's themes directory (/usr/share/gnome-mahjongg/themes, YMMV). After copying, it can be used in Mahjongg by opening preferences and selecting it in the Theme dropdown.

An image can be any size, makemahjongg will scale it to fit a tile. Generally images with an aspect ratio close to 1:1 work best.

makemahjongg allows for embedding parameters into the filename. So far only one parameter is recognized: resample. E.g. when a file inside source_directory is named this:

31-childlike_empress__resample_NEAREST.png

...makemahjongg will resample the image using the NEAREST algorithm instead of the default LANCZOS. Valid values for resample are keys into PIL's Image.Resampling enum.

Parameters are separated by double underscore. If someone expanded on the parseparams function and added e.g. a flip parameter with values of horizontal, vertical, a filename such as

31-childlike_empress__resample_NEAREST__flip_horizontal.png

would apply both resampling using NEAREST and horizontal flipping.

GNOME Mahjongg's rules include two groups of four 'bonus tiles' each, where any tile inside a group matches any other tile within the same group. In the postmodern theme for example, these are the four blue and the four yellow tiles. makemahjongg applies rounded rectangles to these tiles to mark them as bonus tiles, so doing this on the input images is not required.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

makemahjongg-0.1.0.tar.gz (46.1 kB view hashes)

Uploaded Source

Built Distribution

makemahjongg-0.1.0-py3-none-any.whl (45.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page