কম্পিউটার টিউটোরিয়াল

PHP-তে imageconvolution() ফাংশন

imageconvolution() ফাংশন

সিনট্যাক্স

bool imageconvolution (img, matrix, div, offset)

প্যারামিটার

  • img: imagecreatetruecolor() ফাংশন দিয়ে ইমেজ তৈরি করুন।

  • matrix: একটি ৩x৩ ম্যাট্রিক্স যা তিনটি ফ্লোটের তিনটি অ্যারের অ্যারে।

  • div: কনভোলিউশনের রেজাল্টের ডিভাইজর, নরমালাইজেশনের জন্য ব্যবহৃত।

  • offset: কালার অফসেট।

রিটার্ন

imageconvolution() ফাংশন সাফল্যে True রিটার্ন করে অথবা ব্যর্থ হলে False।

উদাহরণ

নিচে একটি উদাহরণ দেওয়া হলো:

<?php 
$img = imagecreatefromgif('https://www.tutorialspoint.com/images/html.gif'); 
$arr = array(array(2, 0, 1), array(-1, -1, 0), array(0, 0, -1)); 
imageconvolution($img, $arr, 1, 127); 
header('Content-Type: image/png'); 
imagepng($img, null, 9); 
?>

আউটপুট

নিচে আউটপুট দেওয়া হলো

PHP-তে imageconvolution() ফাংশন

উদাহরণ

একই ইমেজের জন্য ভিন্ন প্যারামিটার ভ্যালু দিয়ে আরেকটি উদাহরণ। পার্থক্য সহজেই বুঝতে পারবেন:

<?php 
$img = imagecreatefromgif('https://www.tutorialspoint.com/images/html.gif'); 
$arr = array(array(3, 2, 1), array(0, 1, 0), array(1, -1, -1)); 
imageconvolution($img, $arr, 3, 110); 
header('Content-Type: image/png'); 
imagepng($img, null, 9); 
?>

আউটপুট

নিচে আউটপুট দেওয়া হলো

PHP-তে imageconvolution() ফাংশন

  1. PHP-তে imagepolygon() ফাংশন

  2. PHP-তে imagefill() ফাংশন

  3. PHP-তে imagefilledrectangle() ফাংশন

  4. PHP-তে imagefilledellipse() ফাংশন