Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
PHP Gmagick 拡張機能を使用して任意の画像ピクセルの色を取得することは可能ですか?
IMagick では、getImagePixelColor メソッドからこの情報を取得できます。
$color = $img->getImagePixelColor($x, $y)->getColor();
GMagick 経由でこの結果を取得するには?
現在、Gmagick でこれを行うネイティブな方法はありません。ただし、これで仕事は完了します。
$img_clone = clone $img; // No need to modify the original object. $img_clone->cropImage(1, 1, $x, $y); $color = $img_clone->getImageHistogram()[0]->getColor();
戻り値
(string) rgb(0,0,0)