Created
July 7, 2014 05:44
-
-
Save kamatari/6d213d317a17ffe4f645 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = "http://31.media.tumblr.com/tumblr_mc4u6lwZHr1qf4k86o1_500.jpg"; | |
$img_string = file_get_contents($url); | |
$img_data = imagecreatefromstring($img_string); | |
// make color | |
$gd = imagecreatetruecolor(1,1); | |
$red = imagecolorallocate($gd, 255, 0, 0); | |
// drawing | |
for ($x = 1;$x<100; $x++) { | |
for ($y=1;$y<100;$y++) { | |
imagesetpixel($img_data, $x, $y, $red); | |
} | |
} | |
// output | |
imagepng($img_data, '/tmp/test.png'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment