Skip to content

A Swift playground to pixelate images into triangles

Notifications You must be signed in to change notification settings

mightyleader/trixelate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Trixelate

A Swift playground to pixelate images into triangles

IMPORTANT

Ensure you have made a directory in ~/Documents called Shared Playground Data. This is accessible by Playgrounds as a place in the filesystem to access files with read/write permissions.

Inside the shared folder create a new folder called Trixelated which will be where the trixelated images are written to.

Inside Trixelated create a folder called Source which is where you put the images you want to trixelate.

In summary, create a folder here: ~/Documents/Shared Playground Data/Trixelated/Source and put in it any images you want to process.

In the Playground itself, change the number for the ratio parameter in the trixelate(imageAtURL) function on line 123 to determine the granularity of the trixelated image. For example, set it to 5 for abstract images and 50 for very detailed ones.

Original

original

Image is copyright Rob Stearn 2018

Trixelated

trixelated

TODO

Handle error if a file access in ~/Documents/Shared Playground Data/Trixelated/Source is not an image file. Provide some better output indication when each image is complete and when all are complete.

About

A Swift playground to pixelate images into triangles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages