public function createImage($seed = '', $file = '')
    {
        if (!$seed) {
            $seed = mt_rand() . time();
        }
        $this->seed = $seed;

        // monochrome wanted?
        if($this->ismono) {
            $this->generateMonoColor();
        }

        // create
        $image = $this->createTransparentImage($this->fullsize, $this->fullsize);
        $arcwidth = $this->fullsize;
        for ($i = $this->rings; $i > 0; $i--) {
            $this->drawRing($image, $arcwidth);
            $arcwidth -= $this->ringwidth;
        }

        // resample for antialiasing
        $out = $this->createTransparentImage($this->size, $this->size);
        imagecopyresampled($out, $image, 0, 0, 0, 0, $this->size, $this->size, $this->fullsize, $this->fullsize);
        if ($file) {
            imagepng($out, $file);
        } else {
            header("Content-type: image/png");
            imagepng($out);
        }
        imagedestroy($out);
        imagedestroy($image);
    }
public function createImage($seed = '', $file = '')
    {
        if (!$seed) {
            $seed = mt_rand() . time();
        }
        $this->seed = $seed;

        // monochrome wanted?
        if($this->ismono) {
            $this->generateMonoColor();
        }

        // create
        $image = $this->createTransparentImage($this->fullsize, $this->fullsize);
        $arcwidth = $this->fullsize;
        for ($i = $this->rings; $i > 0; $i--) {
            $this->drawRing($image, $arcwidth);
            $arcwidth -= $this->ringwidth;
        }

        // resample for antialiasing
        $out = $this->createTransparentImage($this->size, $this->size);
        imagecopyresampled($out, $image, 0, 0, 0, 0, $this->size, $this->size, $this->fullsize, $this->fullsize);
        if ($file) {
            imagepng($out, $file);
        } else {
            header("Content-type: image/png");
            imagepng($out);
        }
        imagedestroy($out);
        imagedestroy($image);
    }
public function createImage ( $ seed = '' , $ file = '' ) { if ( ! $ seed ) { $ seed = mt_rand ( ) . time ( ) ; } $ this -> seed = $ seed ; // monochrome wanted? if ( $ this -> ismono ) { $ this -> generateMonoColor ( ) ; } // create $ image = $ this -> createTransparentImage ( $ this -> fullsize , $ this -> fullsize ) ; $ arcwidth = $ this -> fullsize ; for ( $ i = $ this -> rings ; $ i > 0 ; $ i -- ) { $ this -> drawRing ( $ image , $ arcwidth ) ; $ arcwidth -= $ this -> ringwidth ; } // resample for antialiasing $ out = $ this -> createTransparentImage ( $ this -> size , $ this -> size ) ; imagecopyresampled ( $ out , $ image , 0 , 0 , 0 , 0 , $ this -> size , $ this -> size , $ this -> fullsize , $ this -> fullsize ) ; if ( $ file ) { imagepng ( $ out , $ file ) ; } else { header ( "Content-type: image/png" ) ; imagepng ( $ out ) ; } imagedestroy ( $ out ) ; imagedestroy ( $ image ) ; }
Generates an ring image

If a seed is given, the image will be based on that seed

@param string $seed initialize the genrator with this string
@param string $file if given, the image is saved at that path, otherwise is printed to browser
Generates an ring image