4th Street Bar Hive-Bar

Hive-Bar Powered by Hive beta-fdb5b5b

Community post

Hypnotic Rectangles

Hypnotic Rectangles

rectangles.gif

I made this picture with a little perl script

 #!/bin/perl
use GD;
 
$picture = new GD::Image(500,500); 
$white = $picture->colorAllocate(255,255,255); 
$black= $picture->colorAllocate(0,0,0); 
$deltax=-3;
for ($x=50;$x<=450;$x=$x+100)
{
	$deltax++;
	$deltay=-3;
	for ($y=50;$y<=450;$y=$y+100)
	{
		$deltay++;
		$deltaz=0;	
		for($z=48;$z>=4;$z=$z-4)
		{	
			$deltaz++;
			$deltaz++;		
			$picture->rectangle($x+$deltax*$deltaz-$z,$y+$deltay*$deltaz-$z,$x+$deltax*$deltaz+$z,$y+$deltay*$deltaz+$z,$black);
		}

	}
}
open(IMG, '>rectangles.gif') or die $!;              
binmode IMG;                                     
print IMG $picture->gif;                          
close(IMG);  

153 upvotes $13.25

Replies (21)

Review before signing

Posting as . Signing with . Keychain permission: Posting. Hive Keychain will ask you to approve this action next.


  
Technical details

Operation fingerprint: