Here a script (R13) + tutorial explaining the Python code behind it, to posterize files.
For example, this icon was ‘posterized’.
The script asks for an input file and some input variables.
Then, based on given input factor, the average pixel color is calculated, an object (Cube or Sphere) is created and a material with the calculated average color created and assigned.
Example: The file is 512×512 and the input factor is 32.
This means that the picture will be ‘divide / posterized’ in 512 / 32 = 16 parts.
Each part is sampled and the average color is calculated. For each part an new objects will be created with the calculated average color.
In total 16*16 = 512 objects will be created.
Here you can download the source and an tutorial explaining the use and the Python code behind it.
This tutorial shows how to calculate (in Python) 2D Voronoi using a brute method. Voronoi is often used to scatter or explode objects.
Note: In mathematics, a Voronoi diagram is a special kind of decomposition of a metric space, determined by distances to a specified family of objects (subsets) in the space.
In this tutorial you will learn:
– Get all polygons of an object.
– Calculate distance between an object and a polygon
(between a Null object and a point of the polygon).
– Add polygon, based on distance, to a selection.
Here you can download the source used in the tutorial.
Note: This is only a 2D solution. I’m still investigation a 3D solution. Any help is welcome!