Function Repository Resource:

# DigitalCirclism

Generate circle packings covering a picture

Contributed by: Christophe Favergeon
 ResourceFunction["DigitalCirclism"][image] compute a circle covering of an image.

## Details and Options

ResourceFunction["DigitalCirclism"] can use the following options:
 "TimeConstraint" 180 the maximum number of seconds allowed for the computation "Pad" 0.0 the padding between the circles "DrawingFunction" Automatic how to draw and style the circles "CompositionFunction" Automatic how to compose the image and the circles "RawResult" False whether to return an image or the list of circles "Radii" {50,20,10,5,3,2} the list of radii used to shrink the radii of the covering
If the maximum number of seconds have been reached, a result will be returned but it may not contain all the circles.
The "DrawingFunction" option accepts a function of the form drawfun[image,centers,radii].
The "CompositionFunction" option accepts a function of the form compfun[image, graphics] where graphics contains the circle covering.
When "RawResult" is True, the function returns a pair of lists: list of centers and list of radii.
The option "Radii" is used to filter the circles from the picture. The algorithm will try to place the biggest circles first. When a circle cannot be placed because it overlaps with other circles, then it will be reduced to the next radius found in the "Radii" list. In practice, you won't often see a big difference in the resulting image if you change this list.
The "Radii" list should be ordered in decreasing order with the smallest radius last.

## Examples

### Basic Examples (1)

Generate a circle covering for a sample image:

 In[1]:=
 Out[1]=

### Options (2)

#### DrawingFunction (1)

We can replace the disks by regular polygons or any other shapes we’d like to use. The opacity can be changed. A "DrawingFunction" option is provided for that purpose:

 In[2]:=
 Out[2]=

#### CompositionFunction (1)

The circle covering and the image can be composed in different ways. A "CompositionFunction" is provided for that purpose:

 In[3]:=
 Out[3]=

### Properties and Relations (3)

Retrieve an image:

 In[4]:=
 Out[4]=

Compute the digital circlism directly:

 In[5]:=
 Out[5]=

Show the circles omitting the largest three:

 In[6]:=
 Out[6]=

## Publisher

Christophe Favergeon

## Version History

• 1.0.0 – 04 February 2021