Skip to content

juzim/card-image-creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create printable image/text combinations

This scripts helps you create printable pdf files of images with text below. My use-case is to have an easy way of creating RFID-cards for my kid's Phonieboxes.

Example

File list

alt text

Result

alt text

Features

  • Puts image on top and filename as text below
  • Turns "__" into linebreaks
  • Each ine can be styled
  • Resizes the image (aspect ratio must be 1:1)
  • Additional configuration for each image by adding a text file with the same name (yaml syntax)
    • Font family
    • Fixed, max and min font size
    • Font color
    • Custom Text
    • Background Colors (todo)
  • Splits result into multiple pages
  • Archives processed images
  • Chooses best font-size for text length

Installation

  1. Download/clone the repository

  2. Copy config.example.yaml to config.yaml

  3. Setup the default font You have to point the config key 'font' in config.yaml to a valid font file.

Example:

font_folder: C:\Windows\Fonts # Windows
font: ariblk.ttf
  1. Put images in the images folder The text gets extracted from the filename (if not specified in the card config file, see below).

  2. (Optional) customize cards All card-specific config values can be overwritten by putting them in a yaml file with the same name as the image. The text can also be changed in the file.

Docker

  1. Build the image with docker build -t cardmaker .

  2. Run the container docker run --user $(id -u):$(id -g) --rm -v $(pwd):/app cardmaker

Python

Install Python 3 and pip

Clone the repository or download the files

Run pip3 install -r requirements.txt in the folder root

Run python3 src/make.py

Windows

!!! Since I don't use windows, this might be broken. Rnning the script in WSL works great.

Execute the bin/make.exe file

Result

The result files are generated in the result folder. If the config value archive is set, the processed files are moved to the archive folder.

Todo

[x] Global config file

[x] More card configurations

[ ] Docker container

[x] Binary builds for Windows

[ ] GUI

[x] Add way to split text in title and subtitle

[ ] Include default fonts

[ ] Config for input and archive folders

[ ] Add some tests

[ ] Make text processing configurable ('__' etc)

[ ] Clean up config values

[x] Fix custom border width

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published