Thank you Graeme. Glad that my program is fixed.
For information, here is how I converted the image with ImageMagick:
$ file static.png
static.png: PNG image data, 400 x 400, 16-bit/color RGBA, non-interlaced
$ magick static.png PNG32:static2.png
$ file static2.png
static2.png: PNG image data, 400 x 400, 8-bit/color RGBA, non-interlacedBut later I found I could create directly 8-bit/color image:
png := TFPWriterPNG.Create;
png.WordSized := FALSE;