Function Repository Resource:

ImageKaleidoscope

Source Notebook

Create a kaleidoscope version of an image

Contributed by: Mark Greenberg

ResourceFunction["ImageKaleidoscope"][img]

produces a kaleidoscope version of img.

Details and Options

ResourceFunction["ImageKaleidoscope"] trims img to make it square, discarding the trimmed portions.
ResourceFunction["ImageKaleidoscope"] takes the following options:
SlidersFalsewhen False, returns an image; when True, returns a manipulate with sliders to adjust the parameters
ImageSize400the width and height of the square output
CenterX.5horizontal location of the input image, from left = 0 to right = 1, in the center of each kaleidoscope tile
CenterY.5vertical location of the input image, from bottom = 0 to top = 1, in the center of each kaleidoscope tile
Zoom.5zoom scale, .1 (closeup) to .5 (wide)
The slider option allows adjustment of the following parameters:
center xmove the region of interest horizontally
center ymove the region of interest vertically
zoomincrease or decrease the zoom level
spin anglerotate the mirrors of the kaleidoscope

Examples

Basic Examples (2) 

Create a kaleidoscope version of an image:

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/415090da-f180-47ad-ab1d-24db95905475"]
Out[1]=

Use the sliders to control the output:

In[2]:=
ResourceFunction["ImageKaleidoscope"][img, Sliders -> True]
Out[2]=

Options (3) 

Use the CenterX and CenterY options to adjust the region shown in each kaleidoscope tile:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/2740f517-eafc-4b77-8ea6-589b66e1bbea"]
Out[3]=

Use the Zoom option to get a closeup view in each kaleidoscope tile:

In[4]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/b8d76021-5ddd-460e-85b7-cd9250be393f"]
Out[4]=

Use the SpinAngle option to rotate each tile like a real kaleidoscope:

In[5]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/71d44777-c8bc-48bb-adf1-b940e50641df"]
Out[5]=

Applications (2) 

Make a trippy abstract image even more trippy:

In[6]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/30ab666a-9f73-413e-a521-2c865aa710fa"]
Out[6]=

Use nature photos for dramatic effect:

In[7]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/acb03e97-1379-4b87-9f14-068975b67c3e"]
Out[7]=

Properties and Relations (1) 

Use the ImageSize option to scale the output:

In[8]:=
ResourceFunction["ImageKaleidoscope"][img, ImageSize -> 240]
Out[8]=

Neat Examples (1) 

Like a real kaleidoscope, ImageKaleidoscope can sometimes surprise you with unexpected results:

In[9]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/d9ddf33f-439a-4a64-82cc-43e3fb417e0f"]
Out[9]=

Publisher

Mark Greenberg

Version History

  • 1.0.0 – 10 October 2019

Related Resources

Author Notes

Kaleidoscopes come with a few different mirror arrangements. The simplest is a cylindrical tube with three mirrors arranged like an equilateral triangle. That is the kind emulated in ImageKaleidoscope. In a real kaleidoscope, the tessellations appear to repeat endlessly into the periphery. This function produces two layers of reflected tessellations, 24 tiles in all. I hope you have as much fun with this function as I had making it.

License Information