PHP Classes

File: demo4_color.php

Recommend this page to a friend!
  Classes of Jakob Riedle   Imagedit Pro   demo4_color.php   Download  
File: demo4_color.php
Role: Example script
Content type: text/plain
Description: Demo 4: Brightness, Contrast, Grayscale
Class: Imagedit Pro
Image manipulation operations and face detection
Author: By
Last change:
Date: 13 years ago
Size: 977 bytes
 

Contents

Class file image Download
<?php
   
include("class.imagedit.php");
    function
brighten($url)
    {
       
$image = new imagedit($url);
       
$image->brightness(
           
25 /* Area: -100 to 100(brightest) */
       
);
       
        return
$image->getJPG();
    }
    function
contrast($url)
    {
       
$image = new imagedit($url);
       
$image->contrast(
            -
90 /* Area: -100 to 100(no Contrast) */
       
);
       
        return
$image->getJPG();
    }
    function
grayscale($url)
    {
       
$image = new imagedit($url);
       
$image->grayscale();
       
        return
$image->getJPG();
    }
?>
<body style="background: yellow;">
    <h1>Imagedit Demo 4: Brightness, Grayscale, Contrast</h1>
    <img style="border: 1px solid black;" src="data:image/jpeg;base64,<?=base64_encode(brighten("portrait.png"))?>"></img>
    <img style="border: 1px solid black;" src="data:image/jpeg;base64,<?=base64_encode(contrast("portrait.png"))?>"></img>
    <img style="border: 1px solid black;" src="data:image/jpeg;base64,<?=base64_encode(grayscale("portrait.png"))?>"></img>
</body>