Skip to content

R0mb0/Mandala_coloring_PDF_generator

Automatic Mandala Coloring PDF Generator

Codacy Badge Python

Maintenance Open Source Love svg3 Donate

CC BY-NC-SA 4.0

Generate beautiful, printable mandalas for coloring, perfectly formatted as PDFs for A4 paper.
All layout, margins, and centering are handled automatically.


Preview

preview

See Example_images to see more examples.


Features

  • Perfect PDF layout for A4: Mandalas are always centered and never cropped.
  • Customizable styles: Choose between random motifs or geometric (classical) mandalas.
  • Color names: Optionally print a color name inside every closed area (helpful for kids/learning).
  • Batch generation: Easily produce multiple unique mandalas in a single run.
  • Windows, Mac, Linux support via automatic dependency checks and install guides.
  • Simple configuration via config.json; interactive setup if the file is missing.
  • Clean output: Only PDFs are kept; all temporary files are wiped after each run.

Installation

1. Dependencies

  • Python 3
  • LaTeX (pdflatex)
  • Python packages: matplotlib, numpy

Linux (Debian/Ubuntu)

sudo apt update
sudo apt install python3 python3-pip texlive-latex-base texlive-latex-extra -y

Windows

Install Chocolatey (Windows package manager), then:

choco install python3 -y
choco install miktex -y

Common pip issues on Windows

If after installing Python via Chocolatey pip does not work or is not found, follow these steps:

  1. Check if pip is available:

    where pip

    If no result, pip is not installed or not in PATH.

  2. Try running pip via Python:

    python -m pip --version

    If this shows an error, pip is likely missing.

  3. Manual pip installation:

    • Download the official get-pip.py script and save it to your computer.
    • Open a Command Prompt in the folder where you saved the script.
    • Run:
      python get-pip.py
    • This will install pip.
  4. Add pip to PATH (if still not found):

    • Locate where pip was installed, typically in:
      C:\Users\<YOUR_USER>\AppData\Local\Programs\Python\Python3x\Scripts\
      
    • Add this folder to your system's PATH:
      • Open "Edit environment variables" in Windows.
      • Add the above path to the PATH variable and restart the Command Prompt.
  5. Test pip:

    pip --version

    or

    python -m pip --version

If you still have issues, pip can always be used with the python -m pip ... syntax!


Mac

Install Homebrew (Mac package manager), then:

brew install python
brew install --cask mactex

Python packages

pip install -r requirements.txt

Usage

  1. Place all project files in the same folder.
  2. Edit (or create) your config.json for custom settings (see below).
  3. Run the generator:
python main.py
  1. Find your PDFs in the output/ folder.

Configuration

All options are set in config.json.
If the file is missing, the script will ask you for all settings interactively.

Example:

{
    "color_hint_mode": "number",
    "color_mode": "advanced",
    "batch_count": 2,
    "mandala_style": "geometric",
    "mandala_max_radius": 1.32
}

See config-parameters.md for a full description of each option.


Expected Behavior

  • PDFs are always perfectly formatted for A4 paper, with a large square mandala centered.
  • No cropping, no layout errors.
  • If you want color names inside each area, set write_color_names to true.
  • Choose style (random or geometric) and color list (basic or advanced) freely.
  • You can generate as many PDFs as you want with one run.
  • If you run the script with no config file, you’ll be prompted to enter every option.

Troubleshooting

  • Missing dependencies: The script will show install instructions for your OS.
  • LaTeX errors: Make sure pdflatex is installed and in your PATH.
  • Images not centered: Check your LaTeX installation and make sure you're using the latest version of the code.
  • Windows pip issue: See the detailed guide in the Windows installation section above.

Shield: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

CC BY-NC-SA 4.0

Not made by AI

About

Mandala Coloring PDF Generator is a cross-platform Python tool that automatically creates printable, perfectly formatted mandala coloring pages as PDF files for A4 paper. Choose between geometric or random styles, customize color hints, and batch-generate unique mandalas—all with easy setup and full support for Windows, Mac, and Linux.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Contributors

Languages