Voting

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

The Note You're Voting On

joe dot scylla at gmail dot com
17 years ago
While it's quite easy and intuitive to get the alpha transparency of a pixel with:

<?php
$rgba
= imagecolorsforindex($image, imagecolorat($image, $x, $y));
$alpha = $rgba["alpha"];
?>

you should use the return value of the command imagecolorat to get the alpha transparency with the code below because it's much faster and will have a major impact if you process every pixel of an image:

<?php
$rgba
= imagecolorat($image, $x, $y);
$alpha = ($rgba & 0x7F000000) >> 24;
?>

<< Back to user notes page

To Top