Git Product home page Git Product logo

genart's Introduction

genart

Generative Art in Go: httpd server and cli command line

Generate images (patterns) from a simple formula:

color = ( C - C * X * Y ) mod MAX

C is a constante, ``(X, Y)` coordinates and MAX the number of colors.

How to use

cmd line

To get help:

$ bin/genart -help
Usage of bin/genart:
  -colors int
    	number of colors (default 216)
  -constant int
    	constant for formula (c): c-c*x*y (default 10)
  -filename string
    	filename to save image (.png) (default "formulaimg.png")
  -formula string
    	formula to use (default "ccxy")
  -size int
    	size of image (default 1000)

Generating an image:

$ make genart
$ bin/genart -filename output.png -colors 100

http server

To get the same image from above cmd line example:

make runserver

Then, on another terminal (or from browser):

$ curl -v http://127.0.0.1:8090/ccxy/size/1000/constant/10/colors/100/ --output output.png

The image

Generatedimage

Another images

formula: ccxy, size:1000, constant:20, colors:200
$ curl -v http://localhost:8090/ccxy/size/1000/constant/20/colors/200/ --output images/ccxy_size:1000_constant:20_colors:200.png
$ bin/genart -formula=ccxy -size=1000 -constant=20 -colors=200 -filename=images/ccxy_size:1000_constant:20_colors:200.png

Formula ccxy, size 1000, constant 20, colors 200

formula: xcyc, size:1000, constant:2, colors:70
$ curl -v http://localhost:8090/xcyc/size/1000/constant/2/colors/70/ --output images/xcyc_size:1000_constant:2_colors:70.png
$ bin/genart -formula=xcyc -size=1000 -constant=2 -colors=70 -filename=images/xcyc_size:1000_constant:2_colors:70.png

Formula xcyc, size 1000, constant 2, colors 70

formula: ccxy, size:1000, constant:2, colors:70
$ curl -v http://localhost:8090/ccxy/size/1000/constant/2/colors/70/ --output images/ccxy_size:1000_constant:2_colors:70.png
$ bin/genart -formula=ccxy -size=1000 -constant=2 -colors=70 -filename=images/ccxy_size:1000_constant:2_colors:70.png

Formula ccxy, size 1000, constant 2, colors 70

Previous works (pt-br)

genart's People

Contributors

paulohrpinheiro avatar

Stargazers

Ellison avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.