PHP Doku:: Change the contrast of the image - function.imagick-contrastimage.html

Verlauf / Chronik / History: (50) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzBildverarbeitung und -generierungImage Processing (ImageMagick)The Imagick classImagick::contrastImage

Ein Service von Reinhard Neidl - Webprogrammierung.

Verdiene Geld mit Deiner Homepage oder deinem Blog: Setzte eine Textlinkwerbung und bestimme den Preis selber.
Einfach kostenlos anmelden und einen Platz auf Deiner Homepage anbieten.
Make money with your homepage or blog: Set a text link advertising and declare the price.
Register free of charge and offer a place on your homepage.
The Imagick class

<<Imagick::__construct

Imagick::contrastStretchImage>>

Imagick::contrastImage

(PECL imagick 2.0.0)

Imagick::contrastImageChange the contrast of the image

Beschreibung

bool Imagick::contrastImage ( bool $sharpen )
Warnung

Diese Funktion ist bis jetzt nicht dokumentiert. Es steht nur die Liste der Argumente zur Verfügung.

Enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a value other than 0 to increase the image contrast otherwise the contrast is reduced.

Parameter-Liste

sharpen

The sharpen value

Rückgabewerte

Liefert TRUE bei Erfolg.

Fehler/Exceptions

Wirft ImagickException bei Fehlern.


Verdiene Geld mit Deiner Homepage oder deinem Blog: Setzte eine Textlinkwerbung und bestimme den Preis selber.
Einfach kostenlos anmelden und einen Platz auf Deiner Homepage anbieten.
Make money with your homepage or blog: Set a text link advertising and declare the price.
Register free of charge and offer a place on your homepage.
2 BenutzerBeiträge:
- Beiträge aktualisieren...
xyking
16.04.2010 17:14
Tip:
<?php
$image
->contrastImage(1); //Increase contrast once
$image->contrastImage(1); //Increase contrast more
$image->contrastImage(1); //Increase contrast even more

$image->contrastImage(0); //Decrease contrast once
$image->contrastImage(0); //Decrease contrast more
$image->contrastImage(0); //Decrease contrast even more

//This could be made into a function like this:
public function contrast($level) {
       
$level = (int)$level;
        if (
$level < -10) {
           
$level = -10;
        } else if (
$level > 10) {
           
$level = 10;
        }
        if (
$level > 0) {
            for (
$i = 0; $i < $level; $i++) {
               
$this->image->contrastImage(1);
            }
        } else if (
$level < 0) {
            for (
$i = $level; $i > 0; $i--) {
               
$this->image->contrastImage(0);
            }
        }
    }
?>
goekar at msn dot com
8.08.2007 14:33
<?
$image
= new Imagick('test.jpg'); // open image file
$image->contrastImage(9); // 0 - 9
$image->writeImage('test2.jpg'); //save image
?>



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)