3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "http://apicloud.me/assets/colortag/image4.jpg"; $im = imagecreatefromjpeg($url); list($w,$h) = getimagesize($url); $colors = []; for($x=0;$x<$w;$x++) { for($y=0;$y<$h;$y++) { $i = imagecolorat($im, $x, $y); $c = imagecolorsforindex($im, $i); $colors[$x][$y] = array_values($c); } } print_r($colors);

preferences:
36.8 ms | 402 KiB | 5 Q