imageitruecolor() 주어진 이미지가 트루 컬러 이미지인지 확인하는 데 사용되는 PHP의 내장 함수입니다. 트루 컬러 이미지에서 각 픽셀은 RGB(빨간색, 녹색 및 파란색) 색상 값으로 지정됩니다.
구문
bool imageistruecolor(resource $image)
매개변수
imageitruecolor() 단일 매개변수, $image 사용 . 이미지를 보유하고 있습니다.
반환 값
imageitruecolor() 주어진 이미지가 트루 컬러이면 True를 반환하고 이미지가 트루 컬러 이미지가 아니면 False를 반환합니다.
예시 1
<?php
// Create an image instance with a true-color image using
//imagecreatefrompng() function.
$img = imagecreatefrompng('C:\xampp\htdocs\Images\img44.png');
// Checked if the image is true-color
$istruecolor = imageistruecolor($img);
// Show the output image to the browser
if($istruecolor) {
echo "The given input image is true-color";
}
?> 출력
// RGB 이미지 입력

// 결과 출력
The given input image is true-color.
예시 2
<?php
// Create an image instance with a true-color image using
//imagecreatefrompng() function.
$img = imagecreatefrompng('C:\xampp\htdocs\Gray.png');
// Checked if the image is true-color
$istruecolor = imageistruecolor($img);
// Show the output image to the browser
if($istruecolor) {
echo "The given input image is not a true-color";
}
?> 출력
// 입력 회색 이미지.

// 출력
The given input image is not a true-color image.