Sephia effects

See all posts Reply

Sephia effects new!
by Mihails, 16 years, 3 months ago
Howe to set sephia effects to edited images?
Any one have some solution?Reply
Re: Sephia effects new!
by Mihails, 16 years, 3 months ago
the solution:
if ($this->image_sephia){
    $pixel = imagecolorsforindex($image_dst, imagecolorat($image_dst, $x, $y));
    $rgb = imagecolorat($image_dst, $x, $y);
    $red   = ($rgb >> 16) & 0xFF;
    $green = ($rgb >> 8)  & 0xFF;
    $blue  = $rgb & 0xFF;
    //sephia
    $red2 = min($red*.393 + $green*.769 + $blue*.189,255);
    $green2 = min($red*.349 + $green*.686 + $blue*.168,255);
    $blue2  = min($red*.272 + $green*.534 + $blue*.131,255);
    $color = imagecolorallocatealpha($image_dst, $red2, $green2, $blue2, $pixel['alpha']);
    imagesetpixel($image_dst, $x, $y, $color);
}
Reply
Re: Sephia effects new!
by colin, 16 years, 3 months ago
i suppose you mean sepia, don't you?

What is the license of the code in your post?Reply