Bug #37060

GIF with transparant background turns black

Added by Dennis Hoffland over 9 years ago. Updated about 7 years ago.

Must have
Image Cropping
Target version:
Start date:
Due date:
% Done:


Estimated time:
TYPO3 Version:
PHP Version:
Is Regression:
Sprint Focus:


I have a GMENU on my website with .gif images as button backgrounds. The original .gif files have a transparant background. When rendered the background turns black. When replaced by .gif images with a coloured background the rendering is normal again.

My hosting details:

PHP 5.3.2-1ubuntu4.15
ImageMagick 6.5.7-8


57f2836b2d.png (943 Bytes) 57f2836b2d.png generated image with black background Mario Rimann, 2012-06-01 13:19
e59a7778f1.png (2.71 KB) e59a7778f1.png generated image with proper background image shown Mario Rimann, 2012-06-01 13:19
issue37060_typoscript.txt (664 Bytes) issue37060_typoscript.txt TS testcase Mario Rimann, 2012-06-01 13:19

Related issues

Related to TYPO3 Core - Bug #36947: GIFBUILDER render twiceClosedTYPO3 Release Team2012-05-08


Updated by Florian Zimmermann over 9 years ago

i have the same prob first.
You need an inverted Mask, see Wiki article http://wiki.typo3.org/GIFBUILDER.
And also try the two localconf.php properties
$TYPO3_CONF_VARS['GFX']['im_negate_mask'] = '1';
$TYPO3_CONF_VARS['GFX']['im_imvMaskState'] = '1';
Please check after you have create this mask and your gifbuilder runs normal again my bug http://forge.typo3.org/issues/36947


Updated by Raphael Zschorsch over 9 years ago

I have the same problem with TYPO3 version 4.7.0 and GIFBUILDER, although not with a gif-file but with a png-file which has semi-transparency. colors of the mask are rendered correctly, but everything which is transparent or semi-transparent is rendered black. I tried various settings in the Install Tool and found nothing that worked (as the problem seems to have existed before). The negate mask didn't help either. I use version 6.7.5-3 of ImageMagick. I have the same ImageMagick version with a TYPO3 4.4.4 and there it's working fine with no special Install Tool configuration or anything.


Updated by Florian Zimmermann over 9 years ago

have you empty the typo3temp/GB and typ3temp/pic dir before you try to render the images again?
I could also be fixed with the fix from my reported bug. Here everthing runs fine now again.


Updated by Gernot Ploiner over 9 years ago

I think i have the same Problem with TYPO3 4.7 on different servers.
When i generate an Image with GIFBUILDER and merge more than one Image together, than appears a black Image.


Updated by Philipp Mueller over 9 years ago


I have the same problem when I try to place a semi-transparent PNG. On TYPO3 4.6.8 it's everything okay. The problem is only in TYPO3 4.7.

  • TYPO3 4.7.0
  • GraphicsMagick 1.3.12 2010-03-08 Q8
  • PHP Version 5.3.3-7+squeeze9

Updated by Mario Rimann over 9 years ago

We see this problem, too. Please see attached a small Typoscript Testcase to demonstrate the problem. It generates two images that consist of multiple layers:

  • a background image (GIF, PNG -> doesn't matter, tested both)
  • a layer that draws a white line at the bottom of the image
  • a text layer

Removing the layer in the middle solves the problem for us. The two generated images are attached, too.

Tested with TYPO3 v4.7.1 on a Ubuntu 10.04 box, PHP 5.3.2-1ubuntu4.15


Updated by Mario Rimann over 9 years ago

I tested the proposed change in t3lib_stdgraphic from Florian Zimmermann that he posted to #36947 (see http://forge.typo3.org/issues/36947#note-4).

It's a three characters change that works and solves the problem as outlined above. After applying the fix to the PHP code, the attached TS testcase then renders a proper image also for the first one (manual clearing of the generated images is required before testing!)

Alltough I could propose a patch to Gerrit, I'm absolutely unsure on the impact of the proposed change. If someone that knows that class and it's functionality better could review the change and get this fixed, this would be highly appreciated!


Updated by Lorenz Ulrich over 9 years ago

@ Mario Rimann: #36947 was only a regression from refactoring. It's in Gerrit now and already has enough +1s, so I think it will be merged soon.


Updated by matthias scheib about 9 years ago

an easy way to to solve the problem for ai/pdfs with transparency that turns the transparent background into black
(Install > Image Processing > Reading image formats > Read AI -> black border around the server-image)

is to add the following options in "All Configuration":

[GFX][im_stripProfileCommand] = +profile '*' -background white -flatten


Updated by BENCH Artwork almost 9 years ago

matthias scheib wrote:

an easy way to to solve the problem for ai/pdfs with transparency that turns the transparent background into black
(Install > Image Processing > Reading image formats > Read AI -> black border around the server-image)

is to add the following options in "All Configuration":

[GFX][im_stripProfileCommand] = +profile '*' -background white -flatten

The im_stripProfileCommand will "fix" the problem with transparent PDF. But after that, i can't upload anymore transparent gif/png for a content element.
is there a way to just apply this command to pdfs?


Updated by Susanne Moog over 7 years ago

  • Status changed from New to Needs Feedback
  • Is Regression set to No


some background:

Transparent turns black unless you specify a different color because transparent = unset color = 0 = black.

The GIFBUILDER should not have this problem anymore as it handles the image conversion different now - if you still have the problem please add a minimal example of the typoscript to reproduce this.




Updated by Alexander Opitz about 7 years ago

  • Status changed from Needs Feedback to Closed
  • Target version deleted (4.7.1)

No feedback within the last 90 days => closing this issue.

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Also available in: Atom PDF