Skip to content

Tiled truecolor filling looses single color transparency #17349

Closed
@cmb69

Description

@cmb69

Description

The following code:

<?php
$tile = imagecreatetruecolor(8, 8);
$red = imagecolorallocate($tile, 255, 0, 0);
imagefilledrectangle($tile, 0, 0, 7, 7, $red);
imagecolortransparent($tile, $red);

$im = imagecreatetruecolor(64, 64);
$bg = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 0, 0, 63, 63, $bg);
imagecolortransparent($im, $bg);
$fg = imagecolorallocate($im, 0, 0, 0);
imageellipse($im, 31, 31, 50, 50, $fg);
imagesettile($im, $tile);
imagealphablending($im, false);
imagefill($im, 31, 31, IMG_COLOR_TILED);

imagegif($im);

Resulted in this output with the bundled libgd:
fill-bad

But I expected this output instead (like with external libgd):
fill-good

PHP Version

PHP 8.3

Operating System

any

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions