Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> PHP

PHP में imageconvolution() फंक्शन

imageconvolution() फंक्शन

सिंटैक्स

bool imageconvolution (img, matrix, div, offset )

पैरामीटर्स

  • img: imagecreatetruecolor() फंक्शन के साथ इमेज बनाएं।

  • matrix: एक 3x3 मैट्रिक्स तीन फ्लोट्स के तीन ऐरे का ऐरे है।

  • 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 में imagefill() फंक्शन PHP में imagefill() फंक्शन

    PHP में imagefill() फंक्शन छवि में निर्दिष्ट प्रारंभिक बिंदु से फ्लड फिल (flood fill) ऑपरेशन करता है - अर्थात्, यह मिलते-जुलते रंग वाले सभी जुड़े हुए क्षेत्र को निर्दिष्ट रंग से भर देता है। सिंटैक्स (Syntax) imagefill(GdImage $image, int $x, int $y, int $color): bool पैरामीटर्स (Parameters) $ima

  1. PHP में imagefilledrectangle() फंक्शन PHP में imagefilledrectangle() फंक्शन

    PHP में imagefilledrectangle() फंक्शन छवि पर एक भरा हुआ आयत (filled rectangle) खींचता है। यह निर्दिष्ट दो कोनों के बीच के पूरे आयताकार क्षेत्र को रंग से भर देता है। सिंटैक्स (Syntax) imagefilledrectangle(GdImage $image, int $x1, int $y1, int $x2, int $y2, int $color): bool पैरामीटर्स (Parameters)

  1. PHP में imagefilledellipse() फंक्शन PHP में imagefilledellipse() फंक्शन

    PHP में imagefilledellipse() फंक्शन छवि पर एक भरा हुआ अंडाकार (filled ellipse) खींचता है। केंद्र निर्देशांक, चौड़ाई और ऊंचाई निर्दिष्ट करके अंडाकार बनाया जाता है। सिंटैक्स (Syntax) imagefilledellipse(GdImage $image, int $cx, int $cy, int $width, int $height, int $color): bool पैरामीटर्स (Paramete