Message Boards Message Boards

Anamorphic Writing and a Birthday card

Posted 5 years ago

While surfing to a web page of the Ephemara Society by Richard D. Sheaff, I came across these amazingly strange "Puzzle cards, written in "anamorphic writing" and alledgedly popular back in the 19th century.

puzzle card

These anamorphic writings are an application of perspective anamorphism. A well defined viewpoint or view direction is needed to see these images correctly. In this case, the view direction has to be at a very sharp angle, almost flat across the surface of the text image. Another, less extreme, example of this are the "STOP" or "BUS" signs painted on city streets. Here the correct viewpoint is at an angle of approximately 25 degrees as is the case of a driver approaching the signs.

stop sign

To create similar cards with Mathematica, a hefty stretching of the text vertically(about 25 times) is needed. We can use ScalingTransform[{1,25}] as I did in my Wolfram Demonstration "Anamorphic Text Messages".
This is code for a similar "Puzzle card" with two perpendicular words stretched in two directions.

Module[{g1, g2, gt1GP, 
  gt2GP}, {g1, 
   g2} = (First[
         Style[#1, FontFamily -> "Arial", FontSize -> 72, 
          FontTracking -> "Extended"], "PDF"]]]] &) /@ {"TREACHEROUS",
     "PERSPECTIVES"}; {gt1GP, 
   gt2GP} = (GeometricTransformation[#1, 
      ScalingTransform[{1, 25}]] &) /@ {g1, g2}; 
 Graphics[Rotate[{gt1GP, Rotate[gt2GP, \[Pi]/2]}, \[Pi]/4]]]

enter image description here

And this is a GIF showing how to read the card in both directions by rotating it around a vertical axis while looking almost parallel to the card's surface:


More than 2 directions for the stretched text are possible.

Module[{g1, g2, g3, gt1GP, gt2GP, 
  gt3GP}, {g1, g2, 
   g3} = (First[
         Style[#1, FontFamily -> "Arial", FontSize -> 72, 
          FontTracking -> "Extended"], "PDF"]]]] &) /@ {"A HAPPY", 
    "BIRTHDAY", "LOVE YOU"}; {gt1GP, gt2GP, 
   gt3GP} = (GeometricTransformation[#1, 
      ScalingTransform[{1, 25}]] &) /@ {g1, g2, g3}; 
 gr = Graphics[{gt1GP, Rotate[gt2GP, \[Pi]/3], 
    Rotate[gt3GP, (2 \[Pi])/3]}]]

happy bday

The above can be used in an "anamorphic puzzle birthday card" (file attached). The card may cause some deciphering by the recipient. You can adapt the texts in the code and make your own secret card to surprise your nerd friends!

Graphics[{gr[[1]], FaceForm[{Blue, Opacity[.12]}], 
  EdgeForm[{Darker[Blue, .5], AbsoluteThickness[6]}], 
  Rectangle[{-400, -100}, {600, 1500}], 
  Text[Style["A secret mesage for you today...", Darker[Red, .35], 
    15], Scaled[{.5, .95}]], 
    "Instruction: Close one eye, hold the card at an angle and look \
flat over the surface...\nlook in the 3 directions...", Black, 6], 
   Scaled[{.5, .05}]]}]

enter image description here


POSTED BY: Erik Mahieu
5 Replies
Posted 5 years ago

Richard Sheaff asked me to correct the following about the image at the top of my original post: "..the image is from my personal website, which is unrelated to The Ephemera society of America"

POSTED BY: Erik Mahieu

Hello Erik,

Thanks for your quick reply and help.

The animation code works perfectly !

Best Regards, Met vriendelijke groeten,....Jos

POSTED BY: Jos Klaps
Posted 5 years ago

Hello, Jos, here is the code for the animation:

DynamicModule[{g1, g2, gt1GP, gt2GP, im, \[Phi] = 0.}, 
 g1 = First[
      Style["TREACHEROUS", FontFamily -> "Arial", FontSize -> 72, 
       FontTracking -> "Wide", FontWeight -> "Bold"], "PDF"]]]]; 
 g2 = First[
      Style["PERSPECTIVES", FontFamily -> "Arial", FontSize -> 72, 
       FontTracking -> "Wide", FontWeight -> "Bold"], "PDF"]]]]; 
 gt1GP = GeometricTransformation[g1, ScalingTransform[{1, 25}]]; 
 gt2GP = GeometricTransformation[g2, ScalingTransform[{1, 25}]];
 im = Image@Graphics[Rotate[{gt1GP, Rotate[gt2GP, \[Pi]/2]}, \[Pi]/4]];
 frames1 = 
    Rotate[Rotate[{Texture[im], EdgeForm[Black], 
       Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 1, 0}}, 
        VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 
           1}}]}, \[Phi], {1, 0, 0}, {0, .5, 0}], 
     t, {0, 0, 1}, {.5, .5, 0}], Boxed -> False, 
    PlotRange -> {{-.25, 1.25}, {-1.25, 1.25}, {-.5, .5}}, 
    ViewPoint -> {0, -2, .25}, ViewAngle -> 14 \[Degree], 
    Lighting -> {{"Ambient", White}}, ImageSize -> 400], {t, 3.92, 
    5.49, .025}];]

The variable frames1 containing all 63 frames is global and can be saved as a GIF:

Export["treach-perps.GIF", frames1]

To further manage the GIF file, I use a free interactive website which lets you slow down, skip frames,...etc.. Good luck

POSTED BY: Erik Mahieu

Hi Erik,

Thanks for sharing this nice code and animation. I made from your code a card for my grandchild's birthday and he was very impressed. I would like also to make an animation, but I’m struggling with the code. Can you tell me how you made this animation?

Thanks for your support !


POSTED BY: Jos Klaps

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor! Thank you, keep it coming, and consider contributing your work to the The Notebook Archive!

POSTED BY: Moderation Team
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract