Python framework for creating and scaling up production of vector graphics assets.

Overview

Board Game Factory

Contributors are welcome here! See the end of readme.

This is a vector-graphics framework intended for creating and scaling up production of reusable assets with vector graphics.

It is a thick wrapper around cairo for vector graphics and pango for fully featured text layout and rendering providing very user-friendly for composing assets.

I've developed it personally to satisfy my need for a solid prototyping engine for board games, but inherently, it is in no way tied to making board games, even though it contains a couple convenience classes for that (such as CardSheet for producing printable card sheets out of lists of components).

Installation

Requires conda and having conda forge in channels (see https://conda-forge.org).

Unfortunately the cairo and pango binary libraries cannot be installed directly with pip.

conda install cairo pango
pip install board-game-factory

Features

  • High quality rendering - BGF is based fully in Vector Graphics, therefore allowing for renders of arbitrary resolution
  • Component Tree structure - similar to making GUIs in Java, you can embed a component inside a component inside a component...
  • Fully extensible components - the best way to use this framework is to create and compose your own components extending base components.
  • Fully dynamic and highly flexible sizing system:
    • Component width/height possible values:
      • INFER - the component decides on its own how large it should be
      • FILL - fill all available remaining space in the parent Container
      • '12.34%' - take up 12.34% of available space
      • 123 - take up 123 pixels
  • Many basic and advanced components are already implemented:
    • Container - base component with a layout manager, you add components into it.
    • Shapes
      • Rectangle
      • RoundedRectangle
      • Circle
      • Line
    • TextUniform - a fully featured text rendering component (exposing most advanced features of pango) for rendering text of a uniform style (all characters have same font, size, color, ...).
    • TextMarkup - advanced text component supporting markup for strings with multiple styles (boldface words, multiple colors, ...)
      • features smart inline laying of icons (any images) for embedding icons directly in text
    • Grid - a special component for creating table structures:
      • each cell can have unique parameters (e.g. layout manager)
      • incredibly flexible row and column definitions (INFER, FILL, %, px)
      • fully featured cell merging
    • just with those few components + LayoutManagers I've made all the samples you can see below in the link on imgur.
  • LayoutManagers
    • Absolute - define pixels
    • HorizontalFlow, VerticalFlow - align automatically to row or column
    • Fully extensible, you can write your own

Usage

For examples of usage see tests.

Things I made with BGF

Samples of prototypes I've made with this framework:

https://imgur.com/a/TS779gR

Issues

Please report any issues and feel free to try and fix them on your own.

Contributors Wanted!

I would love to welcome people on board who would like to extend the project or improve it, if you're interested you can drop in a PR directly or we can first discuss, you can reach me at adam.volny at gmail dot com.

For a hobby project, I think it has a surprisingly high quality of design and code. There are is quite a good test coverage, all tests are performed directly against rendered references. This allowed for controlled development of many of the complex features in this framework (dynamic sizing & positioning is really difficult with this amount of supported features).

It could be extended to do many things (e.g. a gui board game asset builder, coupled with inputs from spreadsheets, ...), I would love to hear Your ideas!

Owner
Adam Volný
Adam Volný
A collection of python scripts which help you programatically create PNGs or GIFs

A collection of python scripts which help you programatically create PNGs or GIFs and their Metadata in bulk with custom rarity rates, upload them to OpenSea & list them for sale.

Tom 30 Dec 24, 2022
Leshycam - Generate Inscryption styled portrait sprites from any image

Leshy's Camera Generate Inscryption styled portrait sprites from any image. Setu

3 Sep 27, 2022
Simple utility to tinker with OPlus images

OPlus image utilities Prerequisites Linux running kernel 5.4 or up (check with uname -r) Image rebuilding Used to rebuild read-only erofs images into

Wiley Lau 15 Dec 28, 2022
Python scripts for semi-automated morphometric analysis of atolls from Landsat satellite Imagery.

AtollGeoMorph Python scripts for semi-automated morphometric analysis of atolls from Landsat satellite Imagery. The python scripts included allow user

1 Dec 16, 2022
Create QR Code for link using Python

Quick Response QR is short and named for a quick read from a cell phone. Used to view information from transitory media and put it on your cell phone.

Coding Taggers 1 Jan 09, 2022
A python program to generate ANSI art from images and videos

ANSI Art Generator A python program that creates ASCII art (with true color support if enabled) from images and videos Dependencies The program runs u

Pratyush Kumar 12 Nov 08, 2022
Extracts random colours from an image

EXTRACT COLOURS This repo contains all the project files. Project Description A Program that extracts 10 random colours from an image and saves the rg

David .K. Danso 3 Dec 13, 2021
Converting Images Into Minecraft Houses

Converting Images Into Minecraft Houses In this particular project, we turned a 2D Image into Minecraft pixel art and then scaled it in 3D such that i

Mathias Oliver Valdbjørn Jørgensen 1 Feb 02, 2022
The following program is used to swap the faces from two images.

Face-Swapping The following program is used to swap the faces from two images. In today's world deep fake technology has become really popular . As a

1 Jan 19, 2022
An agnostic Canvas API for the browser-less and insane

Apollo An agnostic Canvas API for the browser-less and mildly insane. Project Apollo is a Pythonic re-imagining of HTML Canvas element implementati

1 Jan 13, 2022
3D Reconstruction Software

Meshroom is a free, open-source 3D Reconstruction Software based on the AliceVision Photogrammetric Computer Vision framework. Learn more details abou

AliceVision 8.7k Jan 02, 2023
Convert a DOS Punk image to text

DOS Punk Text Inspired by MAX CAPACITY's DOS Punks & the amazing DOS Punk community. DOS Punk Text is a Python 3 script that renders a DOS Punk image

4 Jan 13, 2022
Turtle graphics || Python

turtle Turtle graphics || Python Rainbow (রংধনু) : Rainbow.using.Python.--.Python.Turtle.graphics.mp4 Human robot (মানব রোবট) : Draw.a.human.robot.usi

Jubair Ahmed Junjun 1 Oct 08, 2021
【萝莉图片算法】高损图像压缩算法!?

【萝莉图片算法】高损图像压缩算法!? 我又发明出新算法了! 这次我发明的是新型高损图像压缩算法——萝莉图片算法!为什么是萝莉图片,这是因为它是使动用法,让图片变小所以是萝莉图片,大家一定要学好语文哦! 压缩效果 太神奇了!压缩率竟然高达99.97%! 与常见压缩算法对比 在图片最终大小为1KB的情况

黄巍 49 Oct 17, 2022
This tool allows the user to convert a 16 by 16 image into a list with numbers representing an object/character.

Room Formatter This tool allows the user to convert a 16 by 16 image into a list with numbers representing an object/character. There is cur

Thomas Landstra 1 Nov 13, 2021
A simple programme for converting url into a qr code (.png file)

QrTk A simple lightweight programme for converting url into a qr code (.png file) Pre-Requisites Before installing the programme , you need to run the

Juss Patel 4 Nov 08, 2021
Rembg is a tool to remove images background.

Rembg is a tool to remove images background.

Daniel Gatis 7.8k Jan 05, 2023
starfish is a Python library for processing images of image-based spatial transcriptomics.

starfish: scalable pipelines for image-based transcriptomics starfish is a Python library for processing images of image-based spatial transcriptomics

199 Dec 08, 2022
A tool and a library for SVG path data transformations.

SVG path data transformation toolkit A tool and a library for SVG path data transformations. Currently it supports a translation and a scaling. Usage

Igor Mikushkin 2 Mar 07, 2022
3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required.

3DSimpleTurntable 3D Model files and source code for rotating turntable. Raspberry Pi, DC servo and PWM modulator required. Preview Construction Print

Thomas Boyle 1 Feb 13, 2022