Draw Frosty Fractal

Draw Frosty Fractal online, free and private. Runs in your browser, no upload, instant and offline.

Classic Koch snowflake (Helge von Koch, 1904) with 4 render modes including an "ice crystal" mode with glow.

How to Use Draw Frosty Fractal

  1. Pick iteration depth (1-7) via the slider. Iter 1 = 12 edges (the triangle with one peak per side). Each subsequent iter quadruples segment count: iter 4 = 768, iter 5 = 3,072, iter 6 = 12,288, iter 7 = 49,152. Iter 7 triggers the "Drawing…" loading state.
  2. Choose render mode: Solid (filled with primary color), Outline (boundary only, line width from slider), Gradient (radial primary-to-secondary fill), or Ice crystal (stroke with glow shadow + 0.85 alpha - best on dark background).
  3. Set primary and secondary colors. Gradient mode uses both (primary at centre, secondary at edge). Other modes use only primary.
  4. Pick canvas size and background. Backgrounds: white, black, dark-blue (default - matches ice mode aesthetic), or transparent. Low-contrast pairings trigger an info toast.
  5. Adjust rotation (0-360° in 15° steps). The snowflake rotates around its centre.
  6. Press Ctrl+Enter or click Draw. Stats show edges, fractal dimension (always 1.2619 - independent of iter), perimeter in display pixels, iter, render time.
  7. Copy or Download. Copy puts PNG bytes on clipboard via ClipboardItem (paste straight into image editors). Download saves frosty-fractal-iter-N.png. Both render at DPR-scaled resolution for Retina crispness.

Frequently Asked Questions

What is the Koch snowflake?

The Koch snowflake was constructed by Swedish mathematician Helge von Koch in 1904 as the first example of a continuous curve that is nowhere-differentiable (no defined tangent at any point – sharp corners everywhere). Starting from an equilateral triangle, each iteration replaces every straight edge with a 4-segment bumped version (divide into thirds, replace middle third with two sides of an equilateral peak pointing outward). The infinite limit has INFINITE perimeter enclosing a FINITE area = (8/5)·A₀ where A₀ is the original triangle’s area.

Why does the dimension stay at 1.2619 for every iteration?

Hausdorff dimension is a property of the LIMIT set, not any finite iteration. The number log(4)/log(3) ≈ 1.2619 comes from self-similarity: each edge is replaced with 4 copies at 1/3 scale. Formula: dim = log(N)/log(S) where N copies at scale 1/S. Iter 1’s edge count is 12; iter 7 is 49,152 – but the LIMITING curve they’re approaching has dim 1.2619. We display it as a constant because it doesn’t change with iter – that’s the whole point of fractal dimension.

Why does perimeter grow but the area doesn’t?

Each iter multiplies perimeter by 4/3 (each edge becomes 4 edges of 1/3 length). So perimeter = 3 × s × (4/3)^n → infinity as n → infinity. But the AREA added per iter shrinks geometrically: iter 1 adds 3 small triangles totalling (3/9)·A₀, iter 2 adds 12 even-smaller triangles totalling (12/81)·A₀, etc. The geometric series converges to a finite total, so the limiting area is finite (= (8/5)·A₀). This is the famous “infinite perimeter, finite area” paradox.

What’s the difference between the 4 render modes?

Solid: ctx.fill() with the closed path. Looks like a clean cut-paper snowflake. Outline: ctx.stroke() only. Shows the geometric structure; useful for studying construction. Gradient: a radial gradient from primary at centre to secondary at edge fills the closed path. Ice crystal: stroke with shadowBlur: 20 + shadowColor = primary + globalAlpha: 0.85 – creates a glowing semi-transparent appearance that looks like backlit ice.

Why is iteration 7 the cap?

Edge count at iter N is 3 × 4^N. At iter 7: 49,152 edges (49,152 separate lineTo calls in one Canvas path). At iter 8: 196,608. At iter 9: 786,432 – at which point the path data alone exceeds 10 MB and rendering becomes seconds-long. Iter 7 is the comfortable ceiling for desktop (~500 ms). On mobile devices iter 7 may take 1-2 s – hence the loading state.

Can I get a triangle pointing UP?

The initial triangle points DOWNWARD by default (vertex at top, base below). To flip it, set rotation to 180°. Or pick a 30° / 90° rotation for off-axis variations. The snowflake is 6-fold rotationally symmetric, so rotation by any multiple of 60° leaves it visually identical.

Why does my ice mode look weird on white background?

Ice mode uses shadowColor = primary. On a white background with light-blue primary, the glow blends into the white – looking washed out. The mode was designed for dark backgrounds (dark-blue default). For white backgrounds, prefer solid or gradient mode. Or pick a darker primary so the glow contrasts. The low-contrast warning toast catches the most extreme cases.

What does “perimeter in display pixels” mean?

The logical perimeter (sum of all segment lengths in the un-scaled fractal coordinate system) gets multiplied by the rendering scale factor. So if the snowflake is auto-scaled to fit a 600×600 canvas with 5% padding, the displayed perimeter is what you’d measure with a ruler on the rendered image. Iter 7 with default settings: perimeter ≈ 60,000 px on a 600 px canvas – the curve, if straightened, would be 100× the canvas width.

Is my data secure?

Yes – 100% client-side. Koch curve recursion and Canvas drawing happen in your browser. No parameters or images leave your device. Verify via your browser’s Network tab.