{"id":136,"date":"2008-12-27T13:15:27","date_gmt":"2008-12-27T20:15:27","guid":{"rendered":"https:\/\/actionsnippet.com\/?p=429"},"modified":"2008-12-27T13:15:27","modified_gmt":"2008-12-27T20:15:27","slug":"blendmode-emboss","status":"publish","type":"post","link":"https:\/\/actionsnippet.com\/?p=136","title":{"rendered":"Blendmode Emboss"},"content":{"rendered":"<pre class=\"brush: as3; title: ; notranslate\" title=\"\">\r\nvar canvas:BitmapData = new BitmapData(500, 500, true, 0xFFFFFFFF);\r\nvar color:BitmapData= new BitmapData(500, 500, true, 0x81666666);\r\nvar over:BitmapData = new BitmapData(500, 500, true, 0xFF000000);\r\naddChild(new Bitmap(canvas, &quot;auto&quot;, true));\r\nvar circle:Shape = new Shape();\r\ncircle.graphics.beginFill(0xFFFFFF,1);\r\ncircle.graphics.drawCircle(0,0,50);\r\nvar m:Matrix = new Matrix();\r\nm.tx = 0;\r\nm.ty = 1;\r\naddEventListener(Event.ENTER_FRAME, onLoop);\r\nfunction onLoop(evt:Event):void {\r\n\tcircle.x = mouseX;\r\n\tcircle.y = mouseY;\r\n\tcanvas.draw(circle, circle.transform.matrix);\r\n\tcanvas.copyPixels(color, color.rect, new Point(0,0), null, null, true);\r\n\tover.copyPixels(canvas, canvas.rect, new Point(0,0), null, null, true);\r\n\tcanvas.draw(over, m, null, BlendMode.SCREEN);\r\n\tover.applyFilter(over, over.rect, new Point(-2,-2), new BlurFilter(10,10,1));\r\n\tcanvas.draw(over, m, null, BlendMode.SUBTRACT);\r\n}\r\n<\/pre>\n<p>Grayscale emboss technique. More info <a href='http:\/\/shapevent.com\/sketchbook\/2008\/09\/29\/microscopy-sketch-emboss\/'>here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>var canvas:BitmapData = new BitmapData(500, 500, true, 0xFFFFFFFF); var color:BitmapData= new BitmapData(500, 500, true, 0x81666666); var over:BitmapData = new BitmapData(500, 500, true, 0xFF000000); addChild(new Bitmap(canvas, &quot;auto&quot;, true)); var circle:Shape = new Shape(); circle.graphics.beginFill(0xFFFFFF,1); circle.graphics.drawCircle(0,0,50); var m:Matrix = new Matrix(); m.tx = 0; m.ty = 1; addEventListener(Event.ENTER_FRAME, onLoop); function onLoop(evt:Event):void { circle.x = mouseX; circle.y = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3,4],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-actionscript","tag-flash"],"_links":{"self":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=136"}],"version-history":[{"count":0,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=\/wp\/v2\/posts\/136\/revisions"}],"wp:attachment":[{"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/actionsnippet.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}