Computer art based on quadtrees.

Overview

Quads

Computer art based on quadtrees.

The program targets an input image. The input image is split into four quadrants. Each quadrant is assigned an averaged color based on the colors in the input image. The quadrant with the largest error is split into its four children quadrants to refine the image. This process is repeated N times.

Web Demo

A web-based version can be seen here:

http://www.michaelfogleman.com/static/quads/

Animation

The first animation shows the natural iterative process of the algorithm.

Animation

The second animation shows a top-down, breadth-first traversal of the final quadtree.

Animation

Samples

Flower

Flower

Apple

Apple

Butterfly

Lenna

Landscape

Zebra

Fractal

Mario

You might also like...
Python Digital Art Generator

Python Digital Art Generator The main goal of this repository is to generate all possible layers permutations given by the user in order to get unique

Pixel art as well as various sets for hand crafting
Pixel art as well as various sets for hand crafting

Pixel art as well as various sets for hand crafting

👾 Python project to help you convert any image into a pixel art.
👾 Python project to help you convert any image into a pixel art.

👾 Pixel Art Generator Python project to help you convert any image into a pixel art. ⚙️ Developer's Guide Things you need to get started with this co

Art directed cropping, useful for responsive images

Art direction sets a focal point and can be used when you need multiple copies of the same Image but also in in different proportions.

Generate waves art for an image
Generate waves art for an image

waves-art Generate waves art for an image. Requirements: OpenCV Numpy Example Usage python waves_art.py --image_path tests/test1.jpg --patch_size 15 T

An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters.
An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters.

Ascii Artist An ascii art generator that's actually good. Does edge detection and selects the most appropriate characters. Installing Installing with

Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library

pyqrack Pure Python bindings for the pure C++11/OpenCL Qrack quantum computer simulator library (PyQrack is just pure Qrack.) IMPORTANT: You must buil

A python based library to help you create unique generative images based on Rarity for your next NFT Project
A python based library to help you create unique generative images based on Rarity for your next NFT Project

Generative-NFT Generate Unique Images based on Rarity A python based library to help you create unique generative images based on Rarity for your next

The ctypes-based simple ImageMagick binding for Python
The ctypes-based simple ImageMagick binding for Python

Wand Wand is a ctypes-based simple ImageMagick binding for Python, supporting 2.7, 3.3+, and PyPy. All functionalities of MagickWand API are implement

Comments
  • compatibility with python 3.4

    compatibility with python 3.4

    Added some casts to int since the result of divisions in Python 3 is automatically cast to float whereas in Python 2 they are still integers (maybe math.floor could be used but it could result in different behaviour).

    Heapq breaks in Python 3 if you push a duplicate on it i.e. push(heap, (0, 0.0, )), push(heap, (0, 0.0, )) breaks it since there is no implementation of lt in Quad. I added a counter (0, 0.0, counter, ) which ensures uniqueness of the tuple and preserves insertion order.

    opened by ghost 2
  • TypeError: integer argument expected, got float

    TypeError: integer argument expected, got float

    First of all thanks for this! I'm doing some visual experiments with this but I get the following when python main.py example.png:

    1 49.6791813927697 2 44.536910327764055 3 39.91618908262801 4 39.04791319794365 5 35.82065887614508 6 32.903885446601905 7 32.326656149530756 8 31.714629322062837 10 31.140527906852704 14 30.613942522457467 18 29.42850703649822 20 28.452708100795892 26 27.83647822542313 33 26.858610254863855 43 25.775960929898222 55 25.270909080544094 67 24.678935588991983 83 24.16320784114418 84 23.433750446224078 111 22.89905634295383 161 22.390065776883368 211 21.88953562147702 283 21.379515331465882 322 20.87853839260973 429 20.37431830735203 487 19.664391058523808 589 19.159472748595544 723 18.657686967639428 834 17.949467911576072 Traceback (most recent call last): File "main.py", line 157, in <module> main() File "main.py", line 143, in main model.render('output.png') File "main.py", line 124, in render draw.rectangle(box, quad.color) File "usr/miniconda3/lib/python3.6/site-packages/PIL/ImageDraw.py", line 245, in rectangle ink, fill = self._getink(outline, fill) File "usr/miniconda3/lib/python3.6/site-packages/PIL/ImageDraw.py", line 119, in _getink fill = self.draw.draw_ink(fill, self.mode) TypeError: integer argument expected, got float

    Do you know how to fix it? I'm on python 3.6.7. Many thanks.

    opened by huraji 1
  • Updated for Python 3

    Updated for Python 3

    Small updates so this runs in Python 3. Mainly updating print statements (including an import to retain backwards compatibility) and fixing float conversions to ints for the box drawing. Only lightly tested!

    opened by robertlayton 2
Owner
Michael Fogleman
Software Engineer at Formlabs
Michael Fogleman
Computer art based on joining transparent images

Computer Art There is no must in art because art is free. Introduction The following tutorial exaplains how to generate computer art based on a series

Computer Art 12 Jul 30, 2022
Generative Art Synthesizer - a python program that generates python programs that generates generative art

GAS - Generative Art Synthesizer Generative Art Synthesizer - a python program that generates python programs that generates generative art. Examples

Alexey Borsky 43 Dec 3, 2022
Img-to-ascii-art - Converter of image to ascii art

img-to-ascii-art Converter of image to ascii art Latest Features. Intoducing Col

null 1 Dec 31, 2021
Convert Image to ASCII Art

Convert Image to ASCII Art Persiapan aplikasi ini menggunakan bahasa python dan beberapa package python. oleh karena itu harus menginstall python dan

Huda Damar 48 Dec 20, 2022
Convert any image into greyscale ASCII art.

Image-to-ASCII Convert any image into greyscale ASCII art.

Ben Smith 12 Jan 15, 2022
vsketch is a Python generative art toolkit for plotters

Generative plotter art environment for Python

Antoine Beyeler 380 Dec 29, 2022
Combinatorial image generator for generative NFT art.

ImageGen Stitches multiple image layers together into one image. Run usage: stitch.py [-h] <backgrounds_dir> <dinos_dir> <traits_dir> <texture_file> <

Dinosols NFT 19 Sep 16, 2022
Samila is a generative art generator written in Python

Samila is a generative art generator written in Python, Samila let's you create arts based on many thousand points. The position of every single point is calculated by a formula, which has random parameters. Because of the random numbers, every image looks different.

Sepand Haghighi 947 Dec 30, 2022
A python program to generate ANSI art from images and videos

ANSI Art Generator A python program that creates ASCII art (with true color support if enabled) from images and videos Dependencies The program runs u

Pratyush Kumar 12 Nov 8, 2022
Using P5.js, Processing and Python to create generative art

Experiments in Generative Art Using Python, Processing, and P5.js Quick Links Daily Sketches March 2021. | Gallery | Repo | Done using P5.js Genuary 2

Ram Narasimhan 33 Jul 6, 2022