{"record":{"id":"1ccb40a4a9f6b947","repo":"roboflow/supervision","slug":"bottomleftorigin-is-not-supported-by-the-fallback","errorCode":null,"errorMessage":"bottomLeftOrigin is not supported by the fallback","messagePattern":"bottomLeftOrigin is not supported by the fallback","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/supervision/_cv2/_text.py","lineNumber":96,"sourceCode":"    img: _ImageArray,\n    text: str,\n    org: tuple[int, int],\n    fontFace: int,\n    fontScale: float,\n    color: Any,\n    thickness: int = 1,\n    lineType: int = _LINE_8,\n    bottomLeftOrigin: bool = False,\n) -> _ImageArray:\n    \"\"\"Render text with a Pillow face, anchored at OpenCV's baseline origin.\n\n    Thickness maps to a Pillow stroke width to emulate OpenCV's bolder strokes.\n    ``bottomLeftOrigin`` (an inverted-axis mode no Supervision caller uses) is\n    rejected rather than silently ignored.\n    \"\"\"\n    del lineType\n    if bottomLeftOrigin:\n        raise ValueError(\"bottomLeftOrigin is not supported by the fallback\")\n    if not text:\n        return img\n\n    font = _load_font(fontFace, fontScale)\n    stroke_width = _stroke_width(thickness)\n    x, y = round(org[0]), round(org[1])\n    left, top, right, bottom = font.getbbox(\n        text, anchor=\"ls\", stroke_width=stroke_width\n    )\n    width, height = right - left, bottom - top\n    if width <= 0 or height <= 0:\n        return img\n\n    mask_image = Image.new(\"1\", (width, height))\n    ImageDraw.Draw(mask_image).text(\n        (-left, -top),\n        text,\n        fill=1,","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/roboflow/supervision/blob/7f254d9784d4c37e0f03cd89ddee164c8db099c0/src/supervision/_cv2/_text.py#L78-L114","documentation":"Thrown by the Pillow-based fallback for cv2.putText. OpenCV's putText has a bottomLeftOrigin flag that renders text with inverted image axes; the fallback does not emulate it, so it raises rather than silently drawing wrong output. No Supervision annotator uses this mode.","triggerScenarios":"Calling cv2.putText(..., bottomLeftOrigin=True) while running without opencv-python, through Supervision's Pillow text renderer.","commonSituations":"Porting legacy OpenCV demo code that used bottomLeftOrigin=True for flipped-coordinate rendering; almost never hit via Supervision's public annotators, only via direct cv2.putText calls in the fallback environment.","solutions":["Pass bottomLeftOrigin=False (the default) and pre-flip the image yourself if you need inverted-axis rendering.","Install opencv-python-headless if you genuinely need bottomLeftOrigin behavior."],"exampleFix":"# before\ncv2.putText(img, 'hi', org, fontFace, 1, color, 2, bottomLeftOrigin=True)\n\n# after\nimg = cv2.flip(img, 0)\ncv2.putText(img, 'hi', (org[0], img.shape[0] - org[1]), fontFace, 1, color, 2)","handlingStrategy":"validation","validationCode":"if bottom_left_origin:\n    raise NotImplementedError('bottomLeftOrigin unsupported without opencv-python')\ncv2.putText(img, text, org, fontFace, scale, color, thickness, bottomLeftOrigin=False)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set bottomLeftOrigin=True in code that must run cv2-free","Pre-flip the image instead of using the flag"],"tags":["opencv-fallback","puttext","pillow","unsupported-feature"],"backgroundTag":null,"analyzedSha":"7f254d9784d4c37e0f03cd89ddee164c8db099c0","analyzedAt":"2026-08-15T05:13:01.950Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}