PHP Classes

File: demo5_transparency.php

Recommend this page to a friend!
  Classes of Jakob Riedle   Imagedit Pro   demo5_transparency.php   Download  
File: demo5_transparency.php
Role: Example script
Content type: text/plain
Description: Demo 5: setting Transparent Color
Class: Imagedit Pro
Image manipulation operations and face detection
Author: By
Last change:
Date: 12 years ago
Size: 1,035 bytes
 

Contents

Class file image Download
<?php
   
include("class.imagedit.php");
    function
set($url)
    {
       
$image = new imagedit($url);
       
$image
           
->setHeight(200,true)
            ->
setTransparent( Array( 254 , 254 , 254 ) , 3 );
       
        return
$image->getPNG();
    }
    function
setFixed($url)
    {
       
$image = new imagedit($url);
       
$image
           
->setHeight(200,true)
            ->
setTransparent( Array( 254 , 254 , 254 ) , 3 , true );
       
        return
$image->getPNG();
    }
    function
original($url){
       
$image = new imagedit($url);
       
$image
           
->setHeight(200,true);
       
        return
$image->getPNG();
    }
?>
<body style="background: yellow;">
    <h1>Imagedit Demo 5: Set Transparent Color</h1>
    <img style="border: 1px solid black;" src="data:image/jpeg;base64,<?=base64_encode(original("mask.png"))?>"></img>Original
    <br><img style="border: 1px solid black;" src="data:image/jpeg;base64,<?=base64_encode(set("mask.png"))?>"></img>Normal Transparency
    <br><img style="border: 1px solid black;" src="data:image/jpeg;base64,<?=base64_encode(setFixed("mask.png"))?>"></img>Fixed
</body>