TYPO3 uses GraphicsMagick to convert images, there's an environment check tool which does a test "Write png" which became broken since updating GraphicsMagick from 1.3.47 to 1.3.48.
works: 1.3.47
broken: >= 1.3.48 including current hg commit fd75d7eb1ec5131efa53c2b0ab044dc6133f5645
The command used is:
'/usr/bin/gm' 'convert' -interlace 'None' -auto-orient '+profile' '*' -auto-orient -geometry 300x225! -colorspace 'RGB' 'png:Test.png[0]' 'installTool-write-pngxxxxx.png'
The image source for the test image is:
Attached you'll find a screenshot of the issue, but it can also easily be reproduced with the command above.
Additional information, looking at png.c the offending commit appears to be:
https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/1fbe312f4f7a52615b948919910b77f803590f15
The previous commit to png.c doesn't show the problem:
https://foss.heptapod.net/graphicsmagick/graphicsmagick/-/commit/a7a31a9eadd9d45213a8042b48633f7b1367a422
It is really weird that I used different ways to retrieve 'Test.png' (e.g. 'curl -O' and firefox download from github repository) and I ended up with files with sizes 227181, 379266, or 20061 bytes. The 20061 byte version appears to be the correct one. The larger ones are corrupt and not even PNG files. I eventually checked out the typo3 repository.
Regardless, I am able to re-create a wrong looking image using the command you supplied.
Due to GM 1.3.48 doing deeper analysis of the input image pixels (1.3.47 does not), it is writing 24-bit RGB rather than 32-bit RGB+alpha.
If I use 1.3.47 and add '-type Optimize' it also produces broken output:
gm convert -interlace 'None' -auto-orient '+profile' '*' -auto-orient -geometry 300x225! -colorspace 'RGB' 'png:Test.png[0]' -type optimize -debug coder 'installTool-write-pngxxxxx.png
This means that it was actually a previously existing condition which was not encountered/reported. There may be redundant ways to specify the output internally and they are in conflict.
If I modify the above command and add '+matte' before, or after, '-type optimize' then the problem does not happen:
This command with +matte added works (but the image lacks useless transparency):
From this behavior, I surmise that there is likely another internal variable which conflicts with the image 'matte' flag and disabling 'matte' (transparency) causes the two values to agree.
The problem is now well-understood and has been corrected. In addition to the default output, I have tested the various documented permutations and they all seem to work.
The fix is submitted to Mercurial as changeset 18163:5a567397c8bc and is included in development snapshot tarball "GraphicsMagick-1.4.020260929".
Closing as fixed now. Please make sure that all works as you expect. Thank you very much for reporting the issue, and also that typo3 is using GraphicsMagick.