note 124527 added to function.imagecolorallocatealpha
| From: | JasonKnight-cutcodedown.com@php.net | Date: | Sun, 22 Dec 2019 11:54:55 +0000 |
| Subject: | note 124527 added to function.imagecolorallocatealpha | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213604@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 45.112.84.4
Probable Submitter: 38.142.137.34 (proxied: 193.37.253.104)
----
Manual Page -- http://php.net/manual/en/function.imagecolorallocatealpha.php
Edit -- https://master.php.net/note/edit/124527
Del: integrated -- https://master.php.net/note/delete/124527/integrated
Del: useless -- https://master.php.net/note/delete/124527/useless
Del: bad code -- https://master.php.net/note/delete/124527/bad+code
Del: spam -- https://master.php.net/note/delete/124527/spam
Del: non-english -- https://master.php.net/note/delete/124527/non-english
Del: in docs -- https://master.php.net/note/delete/124527/in+docs
Del: other reasons-- https://master.php.net/note/delete/124527
Reject -- https://master.php.net/note/reject/124527
Search -- https://master.php.net/manage/user-notes.php