To overlay text on image I use the following code:
import * as gmagick from "gm";
const gm = gmagick.subClass({ imageMagick: false });
gm(200, 200, "#ffaca2")
.region(200, 200, 0, 0)
.gravity("Center")
.font("../fonts/OpenSans-Regular2.ttf", 22)
.fill("#000000")
.drawText(0, 0, "AB")
.setFormat("png")
.quality(4);
Operating system: Alpine Linux 3.21
apk add libwebp libwebp-tools freetype graphicsmagick
gm==1.25.0
The text is missing on image if installed GraphicsMagick == 1.3.43-1.3.45.
With older versions of GraphicsMagick up to 1.3.42, this code works correctly.