2013年8月7日星期三

Anonwhat: ASCII Art Generator


In the "something completely different" category today, anonwhat has created an image-to-ASCII art tutorial that takes in an image and, using PHP's GD functionality and a bit of logic, transforms it.



In this tutorial, we are going to create a simple web-based ASCII Art Generator. The concepts found in this tutorial can be applied to other languages. [It is] a simple ASCII Art Generator takes in an image, grayscales it, pixelates it, then prints out a character for each block on the pixelated image based on how "dark" the block is.


The tutorial walks you through the steps needed to make the simple script. It analyzes the image looking at the "blackness" (a combination of the values from imagecolorat and imagecolorsforindex). ACSII characters are then substituted for different "blackness" ranges with the result looking something like this.


Link: http://fuzzicode.com/create/ascii-art-generator

没有评论:

发表评论