LonghornPHP 2026

Voting

: zero plus three?
(Example: nine)

The Note You're Voting On

eric (at) junioronline.us
20 years ago
If you only wish to extract the alpha value for a color, you can simply extract it like so:

<?php

    $color = imagecolorat($im, 50, 50);
    $alpha = $color >> 24;

?>

It actually shifts off the first 24 bits (where 8x3 are used for each color), and returns the remaining 7 allocated bits (commonly used for alpha)

<< Back to user notes page

To Top