[TYPO3-dev] backColor=transparent GIFUBILDER
Jigal van Hemert
jigal at xs4all.nl
Sun Feb 12 19:19:29 CET 2012
Hi,
On 12-2-2012 15:58, Georg Grossberger wrote:
> Don't know when or if it's going to be merged though. I'll push a 4.7
> patch once this one is applied.
Patches should go to the highest version they are targetted at first.
Regarding the challenge for transparency support, the problem is really
in GD:
- imagealphablending(), it supports two blending modes:
* blending mode : the alpha transparency of the colour applied to a
pixel is used to determine how much of the underlying colour should
shine through. The resulting pixel is opaque (!)
* non-blending mode : the drawing colour with transparency replaces
the underlying pixel. The resulting pixel (partly) transparent
We like to have a third mode actually, where the resulting pixel is
(partly) transparent and the colour and transparency are calculated from
the original pixel and the applied colour.
- imagesavealpha(), this enables the resulting image to be saved with an
alpha channel. You have to unset imagealphablending to use this.
So, there is no way to combine two transparent images and have an image
with transparency as result. To combine two transparent images we need
to enable blending mode, but the result is an opaque image.
If we want an image with an alpha channel we have to disable the
blending mode. Now we can't combine two transparent images any more.
If you read the comments below the imagealphablending() documentation
[1] you'll see that a lot of people try to solve the problem of
combining two transparent images into a transparent result. The only
solution seems to be to calculate the transparency for every pixel in
the images. With larger images this can take "forever".
The only way out is a rewrite of the graphics functions and let GM/IM
(with possibly a GD fallback) do these operations.
--
Kind regards / met vriendelijke groet,
Jigal van Hemert.
More information about the TYPO3-dev
mailing list