function findBestBackgroundColorFromBottomLine($filepath) { if (!file_exists($filepath)) { return "#000000"; } $info = getimagesize($filepath); if (!$info) { return "#000000"; } $mime = $info["mime"]; if ($mime == "image/jpeg") { $img = imagecreatefromjpeg($filepath); } elseif ($mime == "image/png") { $img = imagecreatefrompng($filepath); } else { return "#000000"; } if (!$img) { return "#000000"; } $width = imagesx($img); $height = imagesy($img); $y = $height - 1; $rTotal = 0; $gTotal = 0; $bTotal = 0; $count = 0; for ($x = 0; $x < $width; $x++) { $rgb = imagecolorat($img, $x, $y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $rTotal += $r; $gTotal += $g; $bTotal += $b; $count++; } imagedestroy($img); if ($count == 0) { return "#000000"; } $rAvg = round($rTotal / $count); $gAvg = round($gTotal / $count); $bAvg = round($bTotal / $count); return sprintf("#%02X%02X%02X", $rAvg, $gAvg, $bAvg); }
Driftsforhold
Normal drift.
Visse Vandværk
Kongshøjvej 121
9210 Aalborg SØ
Mobil: 2540 7859
Email: vissevand@gmail.com
CVR. NR. 46 15 26 54