array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.imagegammacorrect.php', 1 => 'imagegammacorrect', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD および Image 関数', ), 'prev' => array ( 0 => 'function.imagefttext.php', 1 => 'imagefttext', ), 'next' => array ( 0 => 'function.imagegd2.php', 1 => 'imagegd2', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/image/functions/imagegammacorrect.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4, PHP 5, PHP 7, PHP 8)
imagegammacorrect — GD イメージにガンマ補正を適用する
指定した GD 画像 image
に
入力ガンマ値、出力ガンマ値を指定してガンマ補正を適用します。
image
imagecreatetruecolor()のような画像作成関数が返す GdImage オブジェクト。
input_gamma
入力ガンマ値。
output_gamma
出力ガンマ値。
バージョン | 説明 |
---|---|
8.0.0 |
image は、
GdImage
クラスのインスタンスを期待するようになりました。
これより前のバージョンでは、有効な gd resource が期待されていました。
|
例1 imagegammacorrect() の使用法
<?php
// 画像のインスタンスを作成します
$im = imagecreatefromgif('php.gif');
// ガンマ補正を out = 1.537 で行います
imagegammacorrect($im, 1.0, 1.537);
// 出力してメモリから解放します
imagegif($im, './php_gamma_corrected.gif');
imagedestroy($im);
?>