Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleh-zayats/legofy
Turn any image into lego block grid.
https://github.com/oleh-zayats/legofy
image image-processing ios ios-swift lego legofy swift swift-4
Last synced: 3 days ago
JSON representation
Turn any image into lego block grid.
- Host: GitHub
- URL: https://github.com/oleh-zayats/legofy
- Owner: oleh-zayats
- License: mit
- Created: 2017-12-14T22:35:01.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-14T11:04:21.000Z (over 5 years ago)
- Last Synced: 2025-02-02T17:08:27.145Z (16 days ago)
- Topics: image, image-processing, ios, ios-swift, lego, legofy, swift, swift-4
- Language: Swift
- Size: 23.8 MB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Legofy




# Installation:
1. Install using [CocoaPods](https://cocoapods.org):
Add the following line to the project's Podfile:
```pod 'Legofy'```
run ```pod install```2. Manually:
Drag Classes folder to your project directory and add brick images from Resources into Assets folder of the project.# How To Use:
Import module:
```swift
import Legofy
```
Initialize service:
```swift
let legofyService = LegofyService(sourceImage: srcImage, brickSize: 50.0, brickType: .legoV2)
```
Setup delegate:
```swift
legofyService?.delegate = self
```Use isPercentProgressEnabled to get progress in percents instaed of default Float value
```swift
legofyService?.isPercentProgressEnabled = true
```Brick types available:
```swift
enum BrickType {
case clean, legoV1, legoV2, legoV3, custom(UIImage)
}
```Blend modes available:
```swift
enum BlendMode {
case multiply, hardLight, colorBurn, difference
}
```Call 'generateImage' to generate image:
```swift
legofyService?.generateImage()
```Or 'generateBrickTileImages' to generate brick tiles and positions (columns/rows):
```swift
legofyService?.generateBrickTileImages()
```## Check out the project in 'Demo' folder.
Don't forget to run ```pod install``` in Demo directory ^^
