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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file makemahjongg-0.1.0.tar.gz.

File metadata

  • Download URL: makemahjongg-0.1.0.tar.gz
  • Upload date:
  • Size: 46.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for makemahjongg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 29c72fb83df18250fe297376ed7f484a885a12bb64e1844ce3858915d94627bb
MD5 980e69a97604a31c9480480c5c1eafe1
BLAKE2b-256 78fcd149986bdf19e8aef4cd92d869e6500b83eb2bb5bef55c30b5ac0dee9f4c

See more details on using hashes here.

File details

Details for the file makemahjongg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: makemahjongg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for makemahjongg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb24b9a524767de4d44d892fcca6dbec7758765ff591c9e15b962ded65f24a5c
MD5 72c17fd898fe499455559a6e95e3d943
BLAKE2b-256 12afbc37d718eaee67fc31c6a63e53c6d0555cb466ccd69134420b6c787eabd4

See more details on using hashes here.

Supported by

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