Bonjour
Sujet en lien avec celui ci, ouvert sur forum php :
https://www.developpez.net/forums/d2.../#post11985463
Je me rends compte que la bibliothèque GD rend tous les pixels un peu plus sombres :
Le code suivant m'affiche "172 179 81 - 172 179 81", mais v2 est plus sombre que Tree2, les images sont en PJ.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 $img = imagecreatefrompng("Tree2.png"); imagealphablending($img, false); imagesavealpha($img, true); $color = imagecolorallocatealpha($img,255,255,255,127); imagefill($img, 0, 0, $color); $rgb = imagecolorat($img, 43, 3); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; echo $r . " " . $g . " " . $b . " - " ; imagepng($img, 'v2.png', 0); imagedestroy($img); $img = imagecreatefrompng("v2.png"); $rgb = imagecolorat($img, 43, 3); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; echo $r . " " . $g . " " . $b;
Pour un même pixel donné, si j'ouvre avec Paintbrush (mac), j'ai bien 172 179 81 pour Tree2, mais 156, 166, 64 pour v2.
Quelqu'un a-t-il une idée ?
On dirait que les format ne sont pas exactement les mêmes, je ne suis pas sûr, je vous mets les propriétés en PJ également.![]()
Partager