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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for makemahjongg-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb24b9a524767de4d44d892fcca6dbec7758765ff591c9e15b962ded65f24a5c |
|
MD5 | 72c17fd898fe499455559a6e95e3d943 |
|
BLAKE2b-256 | 12afbc37d718eaee67fc31c6a63e53c6d0555cb466ccd69134420b6c787eabd4 |