imageistruecolor() পিএইচপি-তে একটি অন্তর্নির্মিত ফাংশন যা প্রদত্ত চিত্রটি সত্য-রঙের চিত্র কিনা তা পরীক্ষা করতে ব্যবহৃত হয়। একটি সত্য-রঙের ছবিতে, প্রতিটি পিক্সেল RGB (লাল, সবুজ এবং নীল) রঙের মান দ্বারা নির্দিষ্ট করা হয়।
সিনট্যাক্স
bool imageistruecolor(resource $image)
পরামিতি
imageistruecolor() একটি একক প্যারামিটার নেয়, $image . এটি ছবিটি ধারণ করে৷
৷রিটার্ন মান
imageistruecolor() প্রদত্ত চিত্রটি সত্য-রঙের হলে সত্য ফেরত দেয় বা অন্যথায়, চিত্রটি সত্য-রঙের চিত্র না হলে এটি মিথ্যা ফেরত দেয়।
উদাহরণ 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.