Skip to main content

Gridder

Gridder can generate grids in image form according to the specified settings, either as brand-new images or drawing on existing ones. Grids can have various shapes, such as square or hexagonal, and are highly configurable.

Suggestions and appreciation are welcome! Feel free to email me or open an issue on Gitlab.

Usage

Gridder can draw either on an empty background or on an existing image.

To use an empty background, run main.py <width> <height> <grid size>, where:

  • <width> is the width of the image in pixels.
  • <height> is the height of the image in pixels.
  • <grid size> is the interval, in pixels, at which each line of the grid will be generated. This effectively corresponds to the side of each square of the grid.

To draw on an existing image, run main.py --file <file path> <grid size>, where:

  • <file path> is the path to the image on which Gridder will paint a grid.
  • <grid size> is as described above.

Note that the --file (or -f) option must be the first argument if specified.

The result of the above will be a file named grid.png in the same directory. If used, the existing image will not be modified.

Options

The following optional arguments (or their aliases) can be provided:

  • --gridtype, alias: -gt specifies the shape of the grid. Possible options:
    • square squares (default),
    • vhex vertical hexes (flat side on top and bottom),
    • hhex horizontal hexes (flat side on left and right),
    • vline vertical lines,
    • hline horizontal lines.
  • --linewidth, alias: -lw specifies the line width of the elements of the grid. Default: 1.
  • --gridcol <colour>, alias: -grc specifies a for the grid, as the name of a colour or a string format recognised by Pillow, such as hex values like #000000.
  • --bgcol <colour>, alias: -bgc specifies a for the background, as the name of a colour or a string format recognised by Pillow, such as hex values like #000000. For a transparent background, omit this argument or specify transparent. NOTE: This cannot be used when drawing on an existing image using -f.
  • --padding <size>, alias -p specifies a padding of pixels around the grid, i.e. a padding between the borders of the image and the actual grid.
  • --paddingtop <size>, ..right, ..bottom, ..left, alias: -pt, -pr, -pb, -pl specify each a padding of specific to the indicated side. Each can be used separately, and they will take priority over the generic --padding option above.
  • --destination, alias -d specifies the file name of the finished image. Do not include extension, as it will always be .png automatically. The default file name is grid.png.

Units

By default, all size arguments, <width>, <height>, <grid size> and all applicable optional parameters use pixels, but other units are also allowed, namely:

  • cm,
  • mm,
  • in.

These units all assume a resolution on 300dpi as customary for printing.

For example, a grid created using the arguments 12cm 12cm 1in will be 1417x1417 pixels and have 300-pixels wide squares.

Known issues

  • Due to rounding errors, hex grids may have some unwanted bold edges.

Metadata

Release files for gridder 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gridder 1.0.5
File Size Uploaded Provenance Actions
gridder-1.0.5.tar.gz 21.1 kB Without provenance Details for gridder-1.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gridder 1.0.5
File Interpreter ABI Platform Actions
gridder-1.0.5-py3-none-any.whl Python 3 none any Details for gridder-1.0.5-py3-none-any.whl

Total release size: 44.0 kB

Release files / gridder-1.0.5.tar.gz

Download URL gridder-1.0.5.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9ba2d9d6d4d29b6ab20fabd07a59c4796743b7d1ea077767e0572e8e8abdaee2
BLAKE2b-256 checksum
How to use checksums
a1707dc5afb5e35a6b7e1bf905955a20b5b1496e98b63c383429ad08a296929c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

Release files / gridder-1.0.5-py3-none-any.whl

Download URL gridder-1.0.5-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2546a573bd2415ec431b4bc3ccdf63e71f012822f4468e29981b10cfb90ff14d
BLAKE2b-256 checksum
How to use checksums
e205b7a5379ca47d5ed70eddb49a1b0efccc22c5ba5645c333c08b48fd22f8e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.4

Security for gridder 1.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page