Project

General

Profile

Actions

Bug #15726

closed

No 100% transparency/opacity with file.mask

Added by Clemens Kalb over 18 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2006-02-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When overlaying images using the file.mask, the colours will always come out wrong.
Example:
Create a GIFBUILDER object with white (#ffffff) background, overlay a 100% green image (gif, #00ff00) with a mask (gif) that is 100% transparent on the left half (#000000) and 100% opaque on right other half (#ffffff). In theory you should get a new image that is #ffffff on the one side and #00ff00 on the other side.
What you get is different, though: The left side will be something like #f9fef9 and the right side #04fe04.

The Reason for this issue is quite trivial:

maskImageOntoImage() in t3lib_stdgraphic uses TYPO3's wrapper function imagecreate() to create all image objects needed in the masking process. If GD2 is used, these images will always come out as true color images. When the images are written to disk, they have to be converted back to 256-color palette images, and this is where the color aberration happens.
Set $truecolor = false and the images come out perfect.

Proposal: If the source files (background, overlay, mask) are 256 color palette images, they should never be converted to truecolor images in the masking process since converting them back will usually return bad colors. The PHP reference for imagetruecolortopalette() admits these problems ("This does not work as well as might be hoped.").

(issue imported from #M2702)


Files


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #15719: GIFBUILDER inverts transparency under certain conditionsClosedBernhard Kraft2006-02-24

Actions
Actions

Also available in: Atom PDF