Skip to main content
added 35 characters in body
Source Link
Szabolcs
  • 238.9k
  • 32
  • 653
  • 1.3k

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

The idea is to randomly scatter disks in a rectangle, and colour them according to the corresponding points of the photo. More points with a higher density are used in regions of high detail or sharp transitions, fewer points elsewhere (to keep their number down).

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphicsMathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

The idea is to randomly scatter disks in a rectangle, and colour them according to the corresponding points of the photo. More points with a higher density are used in regions of high detail or sharp transitions, fewer points elsewhere (to keep their number down).

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

The idea is to randomly scatter disks in a rectangle, and colour them according to the corresponding points of the photo. More points with a higher density are used in regions of high detail or sharp transitions, fewer points elsewhere (to keep their number down).

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics

added 267 characters in body
Source Link
Szabolcs
  • 238.9k
  • 32
  • 653
  • 1.3k

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

The idea is to randomly scatter disks in a rectangle, and colour them according to the corresponding points of the photo. More points with a higher density are used in regions of high detail or sharp transitions, fewer points elsewhere (to keep their number down).

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

The idea is to randomly scatter disks in a rectangle, and colour them according to the corresponding points of the photo. More points with a higher density are used in regions of high detail or sharp transitions, fewer points elsewhere (to keep their number down).

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics

Source Link
Szabolcs
  • 238.9k
  • 32
  • 653
  • 1.3k

This is from an old notebook of mine. The girl from Ipanema, composed of 35,000 points. (Note true pointillism, perhaps someone can do that one as well.) Sorry about the messy code and the slow processing.

img = Import["http://farm1.staticflickr.com/125/409696380_05f5c89a37_b_d.jpg"] 

The Girl from Ipanema

etf = EntropyFilter[img, 12] // ImageAdjust sdf = ColorConvert[StandardDeviationFilter[img, 5], "GrayScale"] // ImageAdjust map = ImageAdd[sdf, etf] // ImageAdjust 

Point size map

mapdata = ImageData[map]; data = ImageData[img]; {w, h} = ImageDimensions[img]; ch = RandomChoice[ (Flatten[mapdata] + 0.1)^1.7 -> Join @@ Table[{i, j}, {i, h}, {j, w}], 35000]; spots = {data[[#1, #2]], {#2, -#1}, 15 (1.1 - mapdata[[#1, #2]])^1.8} & @@@ ch; spots = Reverse@SortBy[spots, Last]; Graphics[{RGBColor[#1], Disk[#2, #3]} & @@@ spots, Background -> GrayLevel[0.75], PlotRange -> {{1, w}, {1, -h}} ] 

Mathematica graphics

Another example (unfortunately I lost the original source photo and it's not as easy to google up as the other one above):

Mathematica graphics