Ben siyah ve beyaz JPEG benim sunucuda depolanan bir koleksiyona sahip. Sembol beyaz bir arka plan üzerinde siyah çizgilerden oluşan bir koleksiyon olduğu bu görüntüler, sembol tabanlı.
Geçtim bir değişkene dayalı anında başka bir renk ile siyah renk değiştirmek için GD kullanmaya çalışıyorum. Şu anda, ben:
Getting the JPEG as: $image = imagecreatefromjpeg($imgURL), Converting a HEX code (#FF0000, say) to RGB through PHP,
Ve sonra bu değişkenleri besleme:
private function colourize_image($image, $colour, $contrast = 0) {
if (!$image) { return false; }
imagealphablending($image, true);
imagesavealpha($image, true);
# Convert hex colour into RGB values
$r = hexdec('0x' . $colour{0} . $colour{1});
$g = hexdec('0x' . $colour{2} . $colour{3});
$b = hexdec('0x' . $colour{4} . $colour{5});
imagefilter($image, IMG_FILTER_COLORIZE, $r, $g, $b);
imagefilter($image, IMG_FILTER_CONTRAST, $contrast);
# Return the GD image object
return $image;
}
Nedense, function (yeni bir renk bindirme olmayacak) hiç çalışmıyor.
Herkes yanlış gidiyorum olarak tavsiye?
Çok teşekkürler.