Add Kaleidoscope Effect to a PNG
Apply a real-time kaleidoscope effect to any PNG image. Adjust segments, rotation, zoom, and mirror mode, then download the result as PNG.
About
A kaleidoscope effect partitions a circular viewport into N congruent angular segments, each spanning 2πN radians. One wedge is sampled from the source image and replicated around the center with alternating horizontal reflections to enforce bilateral symmetry across every seam. Getting segment count or mirror alignment wrong produces visible discontinuities at boundaries. This tool computes the triangular clip region, applies affine transforms per segment, and composites the result in real time on an HTML Canvas. It approximates an ideal optical kaleidoscope assuming a flat 2D source and uniform illumination. The rotation parameter is purely aesthetic and does not affect the underlying symmetry group. Note: very high segment counts (above 32) produce near-uniform color averaging because each wedge samples fewer source pixels.
Formulas
Each segment k occupies the angular range from k ⋅ θ to (k + 1) ⋅ θ, where the wedge angle is:
For mirrored mode, odd-indexed segments are drawn with a horizontal scale factor of −1, producing dihedral symmetry group DN. Without mirroring, the result belongs to cyclic group CN. The rotation offset φ is added to the base angle of each segment:
The source image is sampled from a triangular clip region defined by the origin and two points on the circle of radius R at angles 0 and θ. Zoom factor Z scales the source sampling area inversely: a zoom of 2 halves the sampled region, magnifying detail.
Where N = number of segments, θ = wedge angle in radians, φ = rotation offset in radians, R = output circle radius in pixels, Z = zoom multiplier, k = segment index from 0 to N − 1.
Reference Data
| Segments (N) | Wedge Angle | Symmetry Group | Visual Character |
|---|---|---|---|
| 3 | 120° | D3 | Triangular, bold geometric patterns |
| 4 | 90° | D4 | Square-like, tiled appearance |
| 6 | 60° | D6 | Hexagonal, classic kaleidoscope |
| 8 | 45° | D8 | Octagonal, ornate snowflake |
| 10 | 36° | D10 | Decagonal, mandala-like |
| 12 | 30° | D12 | Dense radial, clock-face symmetry |
| 16 | 22.5° | D16 | Fine star-burst, detailed edges |
| 20 | 18° | D20 | Near-circular, high repetition |
| 24 | 15° | D24 | Very fine radial texture |
| 32 | 11.25° | D32 | Near-uniform averaging begins |
| 3 (no mirror) | 120° | C3 | Rotational only, no reflection |
| 6 (no mirror) | 60° | C6 | Pinwheel, chiral pattern |