For Mr. Gif in exchange for some stereoscopic magic.

To see Mathematica code:


MrGifsHat1 := ImageResize[Import["MrGifsHattrans.gif"], 75]

dim := MrGifsHat1 // ImageDimensions

d := dim[[1]]

Pt := Table[{W*d, L*d}, {W, {1/4, 3/4}}, {L, {1/4, 3/4}}]

Hat3D := Table[
ImageCrop[
ImagePerspectiveTransformation[MrGifsHat1,
FindGeometricTransform[
{Pt[[1, 1]], Pt[[1, 2]], Pt[[2, 1]], Pt[[2, 2]]},
{Pt[[1, 1]] + {s, s}, Pt[[1, 2]] + {s, -s},
Pt[[2, 1]] + {-s, -s}, Pt[[2, 2]] + {-s, s}},
"Transformation" -> "Perspective"][[2]],
DataRange -> Full, PlotRange -> All],
{70, 70}],
{s, -1.5, .5, 2/3}]

RasterData[img_, z_] :=
ImageData[
Rasterize[
ImageResize[ColorConvert[img, "GrayLevel"], z],
RasterSize -> 64],
"Byte"]

RasterTable := Table[RasterData[Hat3D[[i]], 75], {i, 4}]

waves[x_, y_, w_, a_, t_] :=
Sin[w ((Cos[a] + Sin[a]) x + (Sin[a] - Cos[a]) y) + t*2 Pi]

B[IS_, CB_, X1_, X2_, Y1_, Y2_, NB_, wB_, aB_, t_] :=
Graphics[
Table[
Disk[
{x - 2 + .5 Abs[Mod[t - 1, 6] - 3], -y},
aB*(1 + Sum[waves[x, y, wB, a*2 Pi/NB, t/24], {a, 0, NB - 1, 1}]/(2 NB))],
{x, -20, CB + 10, 1}, {y, -20, CB, 1}],
PlotRange -> {{X1, X2}, {Y1, Y2}}, ImageSize -> IS]


G[ImgData_, IS_, R_, C_, X1_, X2_, Y1_, Y2_, N_, w_, A_, t_] :=
Graphics[
Table[
Disk[
{x, -y},
.4 (1 - Part[ImgData, y + 1, x + 1, 1]/255)*
A (1 + Sum[waves[x, y, w, a*2 Pi/N, t], {a, 0, N - 1, 1}]/(2 N))],
  {x, 0, R, 1}, {y, 0, C, 1}],
 PlotRange -> {{X1, X2}, {Y1, Y2}}, ImageSize -> IS]

T[t_] :=
Table[
Show[
B[480, 100, -5, 75, 5, -75, 5, 1.7, .4, t],
G[RasterTable[[4 - Abs[Mod[t - 1, 6] - 3]]],
 500, 69, 69, -5, 75, 5, -75, 5, 1.4, 1.6, t/24]
],
{t, 1, 24, 1}]

ListAnimate[
T[t],
AnimationRunning-> False]



MrGifsHat2 := ImageResize[Import["MrGifsHat.gif"], 80]

MrGifRaster2 := RasterData[MrGifsHat2, 80]


ListAnimate[
Table[
G[MrGifRaster2, 490, 75, 70, 5, 75, 0, -70, 5, 1.4, 1.6, t],
{t, 0, .95, .05}],
AnimationRunning->False]
 
  1. stopdontthinkdoit reblogged this from mrgif
  2. unikus reblogged this from mrgif
  3. antvctr reblogged this from txhxt
  4. txhxt reblogged this from mrgif
  5. ronenreblogs reblogged this from mrgif and added:
    kewl
  6. xoxo7474 reblogged this from mrgif
  7. muffinmook reblogged this from morecashforads
  8. morecashforads reblogged this from mrgif
  9. pedromorelato reblogged this from mrgif
  10. a-r-tamayo-aspiro reblogged this from mrgif
  11. chroni-cle reblogged this from mrgif
  12. apilden reblogged this from mrgif
  13. total-carnage reblogged this from mrgif