63

As we all know our site's logo was completely generated by Mathematica. I suppose it is quite natural to make the next step -- to generate the animated version of this logo. There's a lot of space for creativity here, and I suggest to consider the following options.

  1. Animated process of construction from scratch, as it is described in Verbeia's blog post.
  2. Animated morphing of original pentagonal star to the current heptagonal one (J.M.'s idea in the comment)
  3. Some less fussy, a neutral animation of the logo itself, more suitable for placing on webpages.
faleichik
  • 12,651
  • 8
  • 43
  • 62

9 Answers9

58

Let me join.

enter image description here

logo = Cases[
   p7 /. triangulate /. moretriangles /. shrink /. shrink /. shrink /. colour3[] /. colour4["SunsetColors", 1, 28/34] , {c__, Polygon[pts__]}, \[Infinity]];
logo = SortBy[logo, First];
p = Evaluate[InterpolatingPolynomial[{
     {0, {0, 0, 0, 0}}, {Pi, {Pi, 0, 0, 0, 0}}, {2 Pi, {2 Pi, 0, 0, 0}}},#]] &;
pp[a_] := If[Abs[a - Pi] < .6, Pi, p@a];(*to stabilize flickering*)
nf = 37;(*number of frames*)
frames = Table[
   Graphics[Thread[Rotate[logo, p@angle]],
    PlotRange -> 1.2, ImageSize -> 240
    ],
   {angle, 0, 2 Pi, (2 Pi)/(nf - 1)}];
ListAnimate@frames
faleichik
  • 12,651
  • 8
  • 43
  • 62
53

Breathing with occluded borders, per Toad's request:

enter image description here

Run the following command to get the Mathematica code

NotebookPut@ImportString[Uncompress@FromCharacterCode@Flatten@ImageData[
               Import@ "https://i.stack.imgur.com/VqjJ9.png","Byte"],"NB"]
Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
42

As per the blog:

Export["breathing.gif", Table[Graphics[
    p7 /. triangulate /. moretriangles /. shrink /. shrink /. shrink /. colour3[] /.
    colour4["SunsetColors", 1, 28/34] /. curve /. bolicsn[(1 - Cos[2 \[Pi] t])/2], 
  ImageSize -> 150], {t, 0, 1, 0.05}]];

breathing

Some good old fashioned colour cycling:

Clear[f];
f[c_] /; c > 2 := c - 2;
f[c_] /; c > 1 := 2 - c;
f[c_] := c;

colour4c[s_: "SunsetColors", a_?NumericQ, b_?NumericQ, c_?NumericQ] :=
  Polygon[v_] /; Length[v] == 4 :>
    {ColorData[s, f[c + a - b Norm[PolygonCentroid[v]]]], Polygon[v]}

Export["ColourCycleLogo.gif", Table[Graphics[
    p7 /. triangulate /. moretriangles /. shrink /. shrink /. shrink /. colour3[] /.
    colour4c["SunsetColors", 1, 28/34, t], 
  ImageSize -> 150], {t, 0, 2, 0.05}], "DisplayDurations" -> ConstantArray[0.05, 41]];

colours

wxffles
  • 14,246
  • 1
  • 43
  • 75
42

Who wanted the automagic? :)

enter image description here

mmastar[as_, nn_: 1] := Graphics[
   Scale[#, 1/max@#, {0, 0}] &[
    Polygon[pt /@ as] /. triangulate /. moretriangles /. shrink /. 
          shrink /. shrink /. colour3[] /. colour4[] /. curve /. 
     bolicsn[nn]], AspectRatio -> Automatic, PlotRange -> 0.025];
da = 0.0001;
max[zu_] := 
  Cases[zu, {_?NumericQ, _?NumericQ}, \[Infinity]] // Norm // Max;
pt[a_] := {Sin@a, Cos@a};
pts0 = Range[ 0, (2 - 2/5) Pi, 2 Pi/5] // N
pts1 = Append[Insert[pts0, pts0[[2]] - da, 2], pts0[[-1]] + da]
pts2 = Range[Pi/7, 2 Pi, 2 Pi/7] // N
ptsat[t_] := (1 - t) pts1 + t pts2;
nn0 = 1; nn1 = 0.0001;
nat[t_] := (1 - t) nn0 + t nn1;
frames = Table[mmastar[ptsat[t], nat[t]], {t, 0, 1, 1/16}] // Reverse;
ListAnimate[frames]
faleichik
  • 12,651
  • 8
  • 43
  • 62
35

Load some images:

size = {200, 200};
foot = ImageResize[Import[
   "http://upload.wikimedia.org/wikipedia/commons/a/ab/Monty_python_foot.png"
  ], size];
spikey = ImageResize[Import[
   "http://upload.wikimedia.org/wikipedia/en/b/bf/MathematicaSpikeyVersion8.png"
  ], size];
mse = ImageResize[Import[
   "https://i.stack.imgur.com/yjrEY.png"
  ], size];

Crop them, squash them, transform them:

feet = Table[ImageCrop[foot, size {1, k}, Top], {k, 0.1, 0.9, 0.1}];
spoke = Table[ImageResize[spikey, size {1, k}], {k, 0.9, 0.1, -0.1}];
logos = Table[ImagePerspectiveTransformation[mse, 
  FindGeometricTransform[{{0, 0}, {1, 0},
    {0.5, 0.5} + {-(1/(-2 - 2 Cos[t])), (-4 - 3 Cos[t] + 8 Sin[t])/(8 + 8 Cos[t])},
    {0.5, 0.5} + {1/(-2 - 2 Cos[t]), (-4 - 3 Cos[t] + 8 Sin[t])/(8 + 8 Cos[t])}},
    {{0, 0}, {1, 0}, {1, 1}, {0, 1}}][[2]], Padding -> White], {t, 0, \[Pi]/2, \[Pi]/40}];
squish = Table[ImageCrop[logos[[1]], size {1, k}, Top], {k, 0.1, 0.9, 0.1}];

Assemble them together:

a = ImageAssemble[List /@ #] & /@ Thread[{feet, spoke}];
b = ImageAssemble[List /@ #] & /@ Thread[{Reverse@feet, squish}];
c = logos;
d = ConstantArray[Last@logos, 5];

Animate:

Export["logoanimate.gif", Join[a, b, c, d]]

1

wxffles
  • 14,246
  • 1
  • 43
  • 75
32

Here's a spinning "3D version" of the logo

enter image description here

Using the code from meta/blog to create the logo (assigned to the variable logo), continue with the following steps:

side[o_] := Block[{z, pts = Partition[
    Table[N[{Cos[t], Sin[t], z}], {t, Pi/14, 2 Pi, 2 Pi/7}], 2, 1, 1]},
    Composition[Polygon, Flatten[#, 1] &] /@ Thread[{pts /. z -> o/2, Reverse /@ pts /. z -> -o/2}]
]

logo3D = With[{d = 0.1}, 
    Graphics3D[{
        {EdgeForm@None, #}, 
        {EdgeForm@None, FaceForm@RGBColor[0.5995136280878135`, 0.20347121886943803`, 0.37787606421753417`], side@d}
        }, Boxed -> False, Lighting -> "Neutral"
    ] & @@ (logo /. Polygon[x__] :> Polygon[{x /. {a_, b_} :> {a, b, d/2}, 
        x /. {a_, b_} :> {a, b, -d/2}}])
]

frames = Table[Graphics3D[
        {Rotate[First@logo3D, x, {0, 1, 0}]},
        Lighting -> "Neutral",
        ViewAngle -> 35 Degree, ViewVector -> {0, 0, 3.5},
        ViewCenter -> {1, 1, 1}/2, ViewRange -> All, ViewVertical -> {0, 1, 0},
        Axes -> False, Boxed -> False, ImageSize -> 400
    ], {x, 0, 2 Pi, Pi/20}
];

Export["spin.gif", frames, "DisplayDurations" -> 0.05];

A "true 3D version" of the logo would involve raised and beveled profiles for the various inner decorations, but that's considerably harder.

rm -rf
  • 88,781
  • 21
  • 293
  • 472
26

A very rough interpretation, which I hope might at least give some ideas:

(* Final image *)
fin = (p7 /. triangulate /. moretriangles /. shrink
      /. shrink /. shrink /. colour3[] /. colour4["SunsetColors", 1, 28/34]);
icycle[ j_, k_] := 
      Table[Graphics[fin[[1 ;; i, j, k]], PlotRange -> 1], {i, 7}] 
kcycle[i_, j_] := 
      Table[Graphics[fin[[i, j, 1 ;; k]], PlotRange -> 1], {k, 4}]
raster = Rasterize/@
    Prepend[Drop[
       Module[{c}, 
        Flatten@
         {Table[(c = icycle[1, 1 ;; m])~Join~Reverse[c], {m, 4}], 
          Table[(c = kcycle[1 ;; 7, 1 ;; m])~Join~Reverse[c], {m, 4}]}], -4],
   Graphics[{White, Rectangle[]}]];
Export["logo.gif", raster]

image

VF1
  • 4,702
  • 23
  • 31
25

Somewhat belatedly, here is a version that starts from random points and slowly coalesces into the logo.

Begin with the logo from the blog entry which is here called img, and apply a jitter filter which randomizes the position of each pixel within a region of specified size. By starting with a large region (100 pixels by 100 pixels) and shrinking down to 1 by 1, the image changes from a point cloud into a geometric object.

video = Table[
   ImageFilter[RandomChoice[Flatten[#, 1]] &, img, i, Interleaving -> True], 
     {i, {100, 90, 80, 70, 60, 50, 40, 30, 25, 20, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}}];

enter image description here

bill s
  • 68,936
  • 4
  • 101
  • 191
18

Not very interesting, but I learnt a few things...

tab = Table[Show[
    Graphics[Rectangle[{-1, -1}, {1, 1}]],
    i (* where i is the final graphic produced by Verbeia's blog post *)  
     /. 
     {GrayLevel[0.85] -> Opacity[0],
      Polygon[{a_, b_, c_, d_}] -> 
       {
        Scale[Rotate[Polygon[{a, b, c, d}], 2 Pi t, {0, 0}], t, {0, 0}]
       }
      }
    ],
   {t, 0, 1, 0.02}]; 

Export["stack-logo.gif", Flatten[Join[tab, Reverse[tab]]]]

stack overrun

cormullion
  • 24,243
  • 4
  • 64
  • 133