PHP 8.5.0 Alpha 2 available for testing

Voting

: max(five, nine)?
(Example: nine)

The Note You're Voting On

admin at phpgfx dot com
17 years ago
this is a sepia filter using microsoft's definition

<?php

function imagesepia( $img ) {
$total = imagecolorstotal( $img );
for (
$i = 0; $i < $total; $i++ ) {
$index = imagecolorsforindex( $img, $i );
$red = ( $index["red"] * 0.393 + $index["green"] * 0.769 + $index["blue"] * 0.189 ) / 1.351;
$green = ( $index["red"] * 0.349 + $index["green"] * 0.686 + $index["blue"] * 0.168 ) / 1.203;
$blue = ( $index["red"] * 0.272 + $index["green"] * 0.534 + $index["blue"] * 0.131 ) / 2.140;
imagecolorset( $img, $i, $red, $green, $blue );
}
}

?>

<< Back to user notes page

To Top