Swiftpack.co - valeriyvan/swift-geometrize as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by valeriyvan.
valeriyvan/swift-geometrize 0.9.7
Swift package for recreating images as geometric primitives
⭐️ 10
🕓 16 weeks ago
iOS macOS
.package(url: "https://github.com/valeriyvan/swift-geometrize.git", from: "0.9.7")


Swift package for recreating images as geometric primitives. It is Swift port of C++ library.


Look geometrize-cli target how package could be used to geometrize images.

Shape Comparison

The matrix below shows typical results for a combination of circles, triangles, rotated rectangles, rotated ellipses and all supported shapes at 50, 200 and 500 total shapes:

50 Shapes 200 Shapes 500 Shapes
Circles Chicken 50 Circles Chicken 200 Circles Chicken 500 Circles
Triangles Chicken 50 Triangles Chicken 200 Triangles Chicken 500 Triangles
Rotated Rectangles Chicken 50 RotatedRectangles Chicken 200 RotatedRectangles Chicken 500 RotatedRectangles
Rotated Ellipses Chicken 50 RotatedEllipses Chicken 200 RotatedEllipses Chicken 500 RotatedEllipses
All Shapes Chicken 50 All Shapes Chicken 200 All Shapes Chicken 500 All Shapes


You could try swift-geometrize in action in Telegram bot Geometrizebot which is also written in Swift and open-sourced.


  • add stroke width for line, polyline and bezier curve;
  • multithreading;
  • solve dealing with randomness in tests;
  • geometrize with predefined or user supplied brush strokes;
  • geometrize with characters (on output will be something which could be called ascii art or art produced by James Cook Type Writer Artist).


Licensed under MIT license.

Buy Me A Coffee


Stars: 10
Last commit: 5 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Fix tests
16 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics