downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imagegd2> <imagefttext
Last updated: Fri, 13 Nov 2009

view this page in

imagegammacorrect

(PHP 4, PHP 5)

imagegammacorrectGD イメージにガンマ補正を適用する

説明

bool imagegammacorrect ( resource $image , float $inputgamma , float $outputgamma )

指定した GD 画像 image に 入力ガンマ値、出力ガンマ値を指定してガンマ補正を適用します。

パラメータ

image

imagecreatetruecolor() のような画像作成関数が返す画像リソース。

inputgamma

入力ガンマ値。

outputgamma

出力ガンマ値。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 imagegammacorrect() の使用法

<?php
// 画像のインスタンスを作成します
$im imagecreatefromgif('php.gif');

// ガンマ補正を out = 1.537 で行います
imagegammacorrect($im1.01.537);

// 出力してメモリから解放します
imagegif($im'./php_gamma_corrected.gif');
imagedestroy($im);
?>



add a note add a note User Contributed Notes
imagegammacorrect
brian dot duncan at fife dot co dot uk
26-Jan-2002 01:46
Just thought I'd add how I used the gamma correction function (seeing as no-one had done so previously).  works great.

I used a form which has a parameter $GAMMA, so I usually type in something like 1.6

$image = ImageCreateFromJpeg ( "pictures/".$PICTURE2 ) ;
if ($GAMMA != "")
{
    $GammaFloat = (double) $GAMMA ;
    imagegammacorrect ($image, 1.0, $GammaFloat ) ;
        // now save the file
    imagejpeg ( $image, "pictures/"."$PICTURE2", 90 ) ;
}

imagegd2> <imagefttext
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites