The text size is measured in pixels, not points, so passing 24 to text should result in an image whose height is 24 (which might not be the case if the size were measured in points).
But the documentation continues with an example where the result of image-height is larger than the font-size used in text.
I understand that when constructing a shape like rectangle with outline mode, that "additional" pixels will be added to draw the shape. image-height seems to know to return the image size without including the line pixels. E.g.
This much I understand. But if I specify a text with font-size 24, wouldn't that mean, to achieve height of 24 pixels, pixels from pixel 0 to pixel 23 be colored. In this case, wouldn't image-height return the value of height given to text, same as it returns the value when passed a square drawn with outlne mode?