|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70802 Confusing alpha values in help
Submitted: 2015-10-27 16:20 UTC Modified: 2017-01-28 19:17 UTC
From: chris at ocproducts dot com Assigned:
Status: Open Package: GD related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-10-27 16:20 UTC] chris at ocproducts dot com
From manual page:

The imagecolorsforindex example embedded within the imagecolorat documentation shows output with alpha of 127.

PHP alpha is inverted from what people normally expect, so people will think 127 is either fully opaque or 50% opaque (depending how knowledgable they are).

In-fact, 127 is 0% opaque, i.e. 100% transparent.

The user is very likely to be confused/misled, as:
a) an example showing a fully transparent pixel is not what they'd assume
b) it is not otherwise mentioned that this example if of a transparent pixel
c) as the RGB components have actual values, a typical user is really going to not expect this, as they don't imagine transparent pixels with RGB values (again, a typical user, not an expert)

If you look at the example on the imagecolorsforindex function page it uses a more normal example.

I suggest the imagecolorat be given an alpha example with 0.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-01-28 17:37 UTC]
-Package: Documentation problem +Package: GD related
 [2017-01-28 19:17 UTC]
Related to bug #67900.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 15:01:30 2024 UTC