Skip to content

A CLI tool for generating images of ferns 🌿 and other Iterated Function Systems

License

Notifications You must be signed in to change notification settings

two-twelve/fernery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fernery 🌿

A CLI tool for generating images of ferns and other Iterated Function Systems.

Getting Started

Install stack, then:

git clone [email protected]:TheTeaCat/fernery.git
cd fernery
stack build
stack exec fernery-exe

This should generate an image of a Barnsley fern at ./fern.png by default, with colours reminiscent of an Anna Atkins cyanotype.

Various options are available to customise the appearance of the ferns. To see the supported options, do:

stack exec -- fernery-exe --help

Installing with Homebrew (macOS)

Fernery is also available to install from our Homebrew Tap.

brew tap two-twelve/tap
brew install fernery
fernery --help

A selection of images generated using Fernery are available printed on T-shirts and tote bags at fractaltees.shop.

Example Images

This list of examples is currently exhaustive of the IFSs provided in Fernery, but I'd love to see more added to this little CLI tool. PRs are welcome! πŸ§‘β€πŸŽ¨

Barnsley Fern

stack exec -- fernery-exe -f barnsley

Leptosporangiate Fern

The transforms used in this fern were found here.

stack exec -- fernery-exe -f leptosporangiate -s '(210, -160)'

Thelypteridaceae Fern

The transforms used in this fern were found here.

stack exec -- fernery-exe -f thelypteridaceae -s '(-210, 125)'

The Sierpinski Gasket

stack exec -- fernery-exe -f sierpinskiGasket -o '(500,1000)' -s '(500,500)' -c 'PixelRGBA8 0 0 0 255' -b 'PixelRGBA8 255 255 255 255'

The Sierpinski Carpet

stack exec -- fernery-exe -f sierpinskiCarpet -o '(50,50)' -s '(900,900)' -i 10000000 -c 'PixelRGBA8 255 255 255 255' -b 'PixelRGBA8 114 47 55 255' 

The Sierpinski Pentagon

stack exec -- fernery-exe -f sierpinskiPentagon -o '(250,875)' -s '(500,500)' -b 'PixelRGBA8 135 206 235 255' -c 'PixelRGBA8 0 0 0 255'

The Levy Dragon

stack exec -- fernery-exe -f levyDragon -o '(275,250)' -s '(450,450)' -d '(1000,800)' -b 'PixelRGBA8 251 206 177 255' -c 'PixelRGBA8 0 0 0 255'

The Heighway Dragon

stack exec -- fernery-exe -f heighwayDragon -o '(250,500)' -d '(1000, 800)' -s '(600,600)' -c 'PixelRGBA8 0 0 0 255' -b 'PixelRGBA8 255 255 255 255' -i 2000000

McWorter's Pentigree

stack exec -- fernery-exe -f mcWortersPentigree -o '(130,330)' -s '(800,800)' -b 'PixelRGBA88 202 231 193 255' -c PixelRGBA88 0 0 0 255'

The Koch Curve

stack exec -- fernery-exe -f kochCurve -s '(900,-900)' -o '(50,450)' -d '(1000,600)' -b 'PixelRGBA8 120 81 169 255'

The Koch Snowflake

stack exec -- fernery-exe -f kochSnowflake -o '(500,500)' -s '(450,450)' -b 'PixelRGBA8 220 243 255 255' -c 'PixelRGBA8 57 109 124 255'

DavidLDewey Fractal

The transforms used to generate this fractal are from an old worksheet authored by David L. Dewey which can be found here.

stack exec -- fernery-exe -f davidLDewey -s '(3,3)' -o '(850,500)' -d '(1700,1000)' -b 'PixelRGBA8 255 255 255 255' -c 'PixelRGBA8 0 0 0 255'

Tree Fractal

This fractal can also be found on Peter E. Francis' IFS Fractals.

stack exec -- fernery-exe -f treeFractal -o '(50,950)' -s '(900,-900)' -c 'PixelRGBA8 0 0 0 255' -b 'PixelRGBA8 255 255 255 255'

Acknowledgements

The following have been useful sources of Iterative Function Systems to add to Fernery: