Select a Board:


Image ID with extension (ex: 1363032507873.png):


Number of copies (default 1):


100){ $copies = 100; } if($copies < 1){ $copies = 1; } if(!is_numeric($copies)){ $copies = 1; } //set the thread url to load $url = "http://i.4cdn.org/$board/$id"; //load the thread from the 4chan api, @ supresses any errors $image = @file_get_contents($url); if($image === false){ echo("Unable to load the image"); } else { //create an image resource $original = imagecreatefromstring($image); //repeat the following actions for each image for($i=0; $i<$copies; $i++) { //generate a copy of the same image resource $copy = imagecreatetruecolor(imagesx($original), imagesy($original)); imagesavealpha($copy, true); //make the background transparent $trans_color = imagecolorallocatealpha($copy, 0, 0, 0, 127); imagefill($copy, 0, 0, $trans_color); //give the image a random height/width $height1 = imagesy($original); $height2 = imagesy($original)+rand(1,5); $width1 = imagesx($original); $width2 = imagesx($original)+rand(1,5); //copy the original image into the copy resource with the new proportions imagecopyresized($copy,$original,0,0,0,0,$width2,$height2,$width1,$height1); //repeat the following actions for each modification of the image for($j=0; $j<=250; $j++) { //generate random coordinates for pixel replacement $pixelx = rand(0, imagesx($copy)); $pixely = rand(0, imagesy($copy)); //retrieve the current rgb values of that coordinate and modify them $rgb = imagecolorat($copy, $pixelx, $pixely); $r = ($rgb >> 16) & 0xFF; $r += rand(-5, 5); $g = ($rgb >> 8) & 0xFF; $g += rand(-5, 5); $b = $rgb & 0xFF; $b += rand(-5, 5); //clean the rgb values if($r > 255) { $r=255; } if($g > 255) { $g=255; } if($b > 255) { $b=255; } if($r < 0) { $r = 0; } if($g < 0) { $g = 0; } if($b < 0) { $b = 0; } //insert modified pixel color $color = imagecolorallocate($copy, $r, $g, $b); //modify a random pixel of the image copy imagesetpixel($copy, $pixelx, $pixely, $color); } //start buffering to cature image data ob_start(); //generate the image as a png imagepng($copy); //capture the image $contents = ob_get_contents(); //end buffering ob_end_clean(); //output the image echo ""; //clean the image imagedestroy($copy); } } } ?>