PHP CLASS:creat fun pixel robots

Discussion in 'PHP' started by astkboy2008, Dec 20, 2009.

  1. #1
    Need to represent data in an easy to digest fashion? Bored of Chernoff's faces? You need pixel robots! Use this class to create a PNG pixel robot of any size from three 8-bit values.
    Example usage
    
    <?php
      header('Content-type: image/png');
    
      require_once('class.pixelrobot.php');
    
      $robot = new pixelRobot();
      $robot->setData(1,128,255);
      $robot->setSize(6);
      $robot->renderPNG();
    ?>
    
    PHP:
    Sample outputs

    Adjusting the output size:
    [​IMG]
    Low to high values for head, body and feet:
    [​IMG]

    Things we should probably add
    • Other image output formats
    • Images to file system
    • ASCII output
    • Better color controls
    • PHP script for inline image attributes
    • jQuery plugin for attributes
    downloads
    phppixelrobot-1.0.zip [1.39 KB]
    or see the class contents
    class.pixelrobots.php [4.09 KB]
     
    astkboy2008, Dec 20, 2009 IP