Function Repository Resource:

Wiggled

Source Notebook

Give your expression a wiggly, jiggly attitude

Contributed by: Bob Sandheinrich

ResourceFunction["Wiggled"][expr]

creates a wiggly image of expr.

Details and Options

ResourceFunction["Wiggled"] can take any expression.
Wiggled returns an Image.
ResourceFunction["Wiggled"] results are intepreted as the value of expr.
The option "WiggleFunction" accepts a function that is applied to the image via ImageTransformation.
If the default "WiggleFunction" of Automatic is used, it can be customized with the following options:
"WiggleMagnitude"0.2size of wiggles
"WiggleFrequency"20frequency ("wigglyness") of wiggles
"WiggleDirection""Vertical"direction of wiggles

Examples

Basic Examples (2) 

Wiggle a plot:

In[1]:=
ResourceFunction["Wiggled"][Plot[5 x, {x, -1, 1}]]
Out[1]=

Wiggle a string:

In[2]:=
ResourceFunction["Wiggled"][WikipediaData["Wiggle"] // Snippet]
Out[2]=

Scope (3) 

Wiggle a resource object:

In[3]:=
ro = ResourceFunction["Wiggled"][
  ResourceObject["Alice in Wonderland"]]
Out[3]=

Copy the previous result from to use in the following code. The data is still straight:

In[4]:=
Snippet[ResourceData[
ResourceObject[<|"Name" -> "Alice in Wonderland", "UUID" -> "2811e842-e9dc-47b2-bcdd-9d03d91b54b0", "ResourceType" -> "DataResource", "Version" -> "1.0.0", "Description" -> "Alice's Adventures in Wonderland, by Lewis Carroll", "RepositoryLocation" -> URL[
     "https://www.wolframcloud.com/objects/resourcesystem/api/1.0"], "ContentSize" -> Quantity[53.288000000000004`, "Kilobytes"], "ContentElements" -> {"Author", "Content", "FormattedText", "FullTitle", "Language", "Lines", "NotebookExpression", "Title",
       "Words"}|>, ResourceSystemBase -> "https://www.wolframcloud.com/objects/resourcesystem/api/1.0"]]]
Out[4]=

Wiggle some numbers:

In[5]:=
ResourceFunction["Wiggled"][Range[500]]
Out[5]=

Wiggle a resource function:

In[6]:=
ResourceFunction["Wiggled"][ResourceFunction["BirdSay"]["Wiggle me"]]
Out[6]=

Options (4) 

WiggleDirection (1) 

Use "WiggleDirection" to wiggle the content horizontally instead of vertically:

In[7]:=
ResourceFunction["Wiggled"][Plot[x, {x, -1, 1}], "WiggleDirection" -> "Horizontal"]
Out[7]=

WiggleMagnitude (1) 

Use "WiggleMagnitude" to control the size of the wiggle:

In[8]:=
Table[ResourceFunction["Wiggled"][Graphics[Circle[]], "WiggleMagnitude" -> mag], {mag, {0.01, 0.02, 0.1}}]
Out[8]=

WiggleFrequency (1) 

Use "WiggleFrequency" to control the wiggliness:

In[9]:=
Table[ResourceFunction["Wiggled"][
  ResourceData["Sample Image: White Dog on a Beach"], "WiggleFrequency" -> freq], {freq, {1, 10, 100}}]
Out[9]=

WiggleFunction (1) 

Use "WiggleFunction" to directly define the wiggling. The function should take an image position and return a list of x and y transformations as in ImageTransformation:

In[10]:=
ResourceFunction["Wiggled"][Plot[x^2, {x, -1, 1}], "WiggleFunction" -> (# + 0.1 {TriangleWave[#[[2]]], SawtoothWave[#[[1]]]} &)]
Out[10]=

Publisher

Bob

Version History

  • 1.0.0 – 13 November 2019

Related Resources

Author Notes

Should be improved for wiggling in 3D

License Information