GitHub 火線榜

GitHub 火線榜 · 倉庫檔案

tdh8316/triangler

:triangular_ruler: Convert images to Low-Poly art using Delaunay triangulation. (簡介來自倉庫自身文件。)

Python#delaunay#delaunay-triangulation#image-processing

資料截至 October 29tdh8316

最好成績

#120

被忽視榜 · 活躍卻無人問津

100

累計 Star

14

Fork 總數

1

近 30 天在榜天數

授權條款: MIT最近 push: October 29Open Issues(含 PR): 1自 2026-10-25 起採集;未知 = 尚未採集到

專案文件

Works on my machine

Python Code style: black License: MIT Stargazers Twitter URL

Overview

📐 Convert images to Low-Poly art using Delaunay triangulation.

sample

Table of contents

  1. Installation
  2. Usage
  3. Use as a library
  4. Sample
  5. License

Installation

You need Python 3.10 or higher.

I strongly recommend to use virtual environment such as Anaconda. You can download Anaconda here.

Follow manual below to create conda virtual environment for Triangler with the Anaconda.

$ conda create -n triangler python=3.12
$ activate triangler
(triangler)$ python -m pip install git+https://github.com/tdh8316/triangler/

Usage

(triangler)$ python -m triangler -h
positional arguments:
  input                 Input image

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        Output image name
  -p POINTS, --points POINTS
                        Number of sample points to use
  -e {canny,entropy,sobel}, --edge-detector {canny,entropy,sobel}
                        Edge detection algorithm
  -s {poisson_disk,threshold}, --sampler {poisson_disk,threshold}
                        Point sampling algorithm
  -r {centroid,mean}, --renderer {centroid,mean}
                        Color polygon rendering algorithm
  -l, --reduce          Reduce the result image size to match the input image
  -V, --version         show program's version number and exit
  -d, --debug           Enable debug mode

API

You can also use Triangler as a library.

import triangler

triangler.convert(
    img="INPUT_IMAGE.jpg",
    save_path="OUTPUT_IMAGE.jpg",
)

For configurable edge detection, sampling, and rendering, see examples/convert_custom.py. Edit the image paths and settings, then run python examples/convert_custom.py with Triangler installed.

Sample

Effect of the number of points

Original Image 5000 Points
sample sample
1000 Points 500 Points
sample sample

More samples

Original Triangler
sample sample

License

Licensed under the MIT License.

Copyright 2024 Donghyeok Tak

Credits

Some algorithms, including the Poisson disk sampling, are based on pmaldonado/PyTri.

當前上榜

  • 120

    被忽視榜 · 活躍卻無人問津

    100 星 · 14 fork · 累計星星(升冪)

    被忽視 →

近 30 天勢頭

累計 Star 走勢

名次走勢

把上榜徽章放進你的 README · tdh8316/triangler[![把上榜徽章放進你的 README](https://git.vaiox.xyz/api/badge/tdh8316/triangler.svg)](https://git.vaiox.xyz/zh-TW/repo/tdh8316/triangler)

Badge · 任何仓库都可以挂 —— 未上榜的仓库显示灰章,上完榜会自动点亮。

<a href="https://git.vaiox.xyz/zh-TW/repo/tdh8316/triangler"><img src="https://git.vaiox.xyz/api/badge/tdh8316/triangler.svg" alt="把上榜徽章放進你的 README" height="20"></a>

← 回到榜單

GitHub 火線榜往日榜發現联系我们 · Contact