Generate beautiful, printable mandalas for coloring, perfectly formatted as PDFs for A4 paper.
All layout, margins, and centering are handled automatically.
- 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.
- Python 3
- LaTeX (pdflatex)
- Python packages: matplotlib, numpy
sudo apt update
sudo apt install python3 python3-pip texlive-latex-base texlive-latex-extra -yInstall Chocolatey (Windows package manager), then:
choco install python3 -y
choco install miktex -yIf after installing Python via Chocolatey pip does not work or is not found, follow these steps:
-
Check if pip is available:
where pip
If no result, pip is not installed or not in PATH.
-
Try running pip via Python:
python -m pip --version
If this shows an error, pip is likely missing.
-
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.
-
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
PATHvariable and restart the Command Prompt.
- Locate where pip was installed, typically in:
-
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!
Install Homebrew (Mac package manager), then:
brew install python
brew install --cask mactexpip install -r requirements.txt- Place all project files in the same folder.
- Edit (or create) your
config.jsonfor custom settings (see below). - Run the generator:
python main.py- Find your PDFs in the
output/folder.
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.
- 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_namesto true. - Choose style (
randomorgeometric) and color list (basicoradvanced) 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.
- Missing dependencies: The script will show install instructions for your OS.
- LaTeX errors: Make sure
pdflatexis 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.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.