고유이미지 (1) 썸네일형 리스트형 [PHP] 이미지에서 색상 팔레트 추출 function colorPalette($imageFile, $numColors, $granularity = 5) { $granularity = max(1, abs((int)$granularity)); $colors = array(); $size = @getimagesize($imageFile); if($size === false) { user_error("Unable to get image size data"); return false; } $img = @imagecreatefromjpeg($imageFile); if(!$img) { user_error("Unable to open image file"); return false; } for($x = 0; $x < $size[0]; $x += $gran.. 이전 1 다음