pillow中image类getbox作用

源代码中返回值为

return: ``(left, top, right, bottom)`` bounding box

即左上右下

在设置背景图

img_background = Image.new('RGB',(800,800),(255,0,0))
#得到box (0,0,800,800)

在设置字体大小图

font = ImageFont.truetype('ARLRDBD.TTF',size=150)
size_text = 'test'
font.getbbox(size_text)
#得到box(0,36,280,144)

这个36是哪里来的?

getbbox 的函数,返回的是图像中非零区域的边界框,你的结果里(0,36,280,144),表示左上角和右下角的坐标。
所以36可以理解是左上角的 y 坐标