{"id":300,"date":"2011-11-21T16:52:21","date_gmt":"2011-11-22T00:52:21","guid":{"rendered":"http:\/\/new.joyofprocessing.com\/blog\/?p=300"},"modified":"2011-11-21T16:52:21","modified_gmt":"2011-11-22T00:52:21","slug":"wavy-image","status":"publish","type":"post","link":"https:\/\/joyofprocessing.com\/blog\/2011\/11\/wavy-image\/","title":{"rendered":"Wavy Image"},"content":{"rendered":"<p><script type=\"application\/processing\">\/\/ Wavy Image - Jim Bumgardner\n\n\/\/   @pjs preload=\"joy_header.png\";\n\nPImage myImage;\nfloat distortion = 5;  \/\/ height of waves\nfloat movement = .01;  \/\/ movement of waves\nfloat detail = 5;      \/\/ tightness of waves\n\nvoid setup()\n{\n  size(275,199);\n  myImage = loadImage(\"\/joy_header.png\");\n}\n\nvoid draw()\n{\n  background(255);\n  for (int i = 0; i < min(width,myImage.width); ++i) {\n    int dev = (int) ((sin((millis()+i*detail)*movement)+1)*distortion);\n    copy(myImage, i,0,1,height, i, -dev,1,height+dev*2);\n  }\n}\n\n<\/script><\/p>\n<div class=\"ps_cap\"><a href=\"\/showexample.php?ex=wavy_image\">source<\/a><\/div>\n<p>An example showing one way to get a wave effect along one axis of an image.  This is done by copying the image in thin vertical strips, and offsetting the position and height of each strip using a sine wave.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>source An example showing one way to get a wave effect along one axis of an image. This is done by copying the image in thin vertical strips, and offsetting the position and height of each strip using a sine wave.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-300","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/posts\/300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/comments?post=300"}],"version-history":[{"count":3,"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/posts\/300\/revisions"}],"predecessor-version":[{"id":303,"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/posts\/300\/revisions\/303"}],"wp:attachment":[{"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/media?parent=300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/categories?post=300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/joyofprocessing.com\/blog\/wp-json\/wp\/v2\/tags?post=300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}