Giter Club home page Giter Club logo

python-van-gogh's Introduction

Python van Gogh

A simple Python script to recreate given images. Takes an image and creates two images of the same size. Then picks a random color from the original image and draws a line of that of random length and width on first image. If first image is more like the original, overwrites the second image with the contents of first image, and vice versa.

The script takes roughly 30 minutes to execute 1 mil iterations when logging is enabled and an image is of size 400x400. Larger images might take longer as the size of drawn lines depend on the size of an image.

Script in action:

Progress Original

Installation

In order to use this script you need to have the following installed:

  • Python 3 (tested on Python 3.7.0)
  • Pillow (pip install Pillow)

Then simply download the script or clone this repo.

Usage

  1. Download or clone this repo to your local machine.
  2. cd into the Python-van-Gogh folder (cd path/to/Python-van-Gogh)
  3. Run the script:
python3 main.py

When the script is running:

  • You will be asked to input number of iterations (recommended more than 5000).
  • You will be asked to input a path to an image

If the image is in the Python-van-Gogh folder you can simply provide the filename with extension (eg. rdj.jpg) or if the image is located elsewhere you can provide an absolute path (eg. /Users/myusername/Desktop/img.png)

python-van-gogh's People

Contributors

heijler avatar indrer avatar u-pi 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.