swift-geometrize

1.2.1

Swift package for recreating images as geometric primitives in form of SVG files
valeriyvan/swift-geometrize

What's New

Use stable version of SwiftLint

2024-05-14T10:15:35Z

What's Changed

Full Changelog: 1.2.0...1.2.1

What's Changed

  • Turn on tests on Ubuntu, fix compile errors in tests by @valeriyvan in #125
  • Fix/turn on tests on ubuntu by @valeriyvan in #126
  • Extend Rgba with initializer from array, array slice, buffer and buffer slice by @valeriyvan in #129
  • Add official SwiftLintBuildToolPlugin from SwiftLint package by @valeriyvan in #130
  • Extend Bitmap with init with parameter ContiguousArray by @valeriyvan in #132
  • Add to Rgba export to array and tuple; Add init from tuple by @valeriyvan in #136
  • Implements initialising Bitmap from PPM string, export of Bitmap into PPM string by @valeriyvan in #137
  • Extend Bitmap with initializer from UIImage and export to UIImage by @valeriyvan in #139
  • Extend Bitmap with initializer form data of png/jpeg and export to png/jpeg by @valeriyvan in #143
  • Add BitmapExporter to export geometrize result into Bitmap by @valeriyvan in #144
  • Add to geometrize-cli ability to output png and jpeg by @valeriyvan in #146
  • Add PrivacyInfo.xcprivacy by @valeriyvan in #147
  • Rename geometrize-cli into geometrize by @valeriyvan in #148
  • Fix for hang geometrizing image filled with solid color by @valeriyvan in #153
  • Introduces GeometrizingSequence by @valeriyvan in #160
  • Remove conformance to ExpressibleByStringLiteral and CustomStringConvertible, use PPM instead by @valeriyvan in #161
  • Fix links to images in README by @valeriyvan in #162

Full Changelog: 1.1.6...1.2.1

Geometrize logo fulltext

swift-geometrize

Swift package for recreating images as geometric primitives. It began as a Swift port of the geometrize-lib C++ library, but it has since evolved in a distinct direction. You can give it a try in web version.

Usage

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

Geometrizebot

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

TODO:

  • ✅ add stroke width for line, polyline and bezier curve;
  • ✅ multithreading;
  • add polygon as shape type;
  • filling shapes with gradient;
  • 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);
  • photo mosaic,
  • string art.

License

Licensed under MIT license.

Buy Me A Coffee

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Sat Nov 02 2024 20:40:21 GMT-0900 (Hawaii-Aleutian Daylight Time)