You can let ImageMagick calculate the size for you if you specify the width and height when you read the label.
var imgLabel = new MagickImage(); imgLabel.Font = "Arial"; imgLabel.BackgroundColor = white; imgLabel.FillColor = black; imgLabel.TextGravity = Gravity.Center; imgLabel.Read("label:" + text2, rect2.Width, rect2.Height);