note 124527 deleted from function.imagecolorallocatealpha by cmb
| From: | cmb@php.net | Date: | Sun, 22 Dec 2019 14:24:35 +0000 |
| Subject: | note 124527 deleted from function.imagecolorallocatealpha by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-213606@lists.php.net to get a copy of this message | ||
Note Submitter: Jason Knight - cutcodedown.com
----
Laughing at the "logic" in the older answers for turning 0..255 alpha into the 127..0 just
for the sheer absurdity of how complex they make it.
$alpha7 = 127 - ($alpha8 >> 1);
DONE. Why are you guys making that so complex?
That said, anyone know why this uses a 7 bit alpha? Kind of sucks since it mangles some PNG and
WEBP.