Skip to content

Itrp Render

POST
/itrp/render
curl --request POST \
--url https://example.com/itrp/render \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "image": "example", "blocks": [ { "text": "example", "translated": "example", "bbox": [ 1 ] } ], "target_lang": "en" }'

Render pre-translated text blocks onto an image (synchronous).

Accepts a base64 image and a list of blocks, each with original text, translated text, and a bounding box. White-fills each bbox and stamps the translated text. Returns the rendered image as base64 JPEG.

This is the render-only variant of /itrp/demo — no OCR or translation is performed. Use this when you already have translated blocks from your own pipeline (e.g. /ocr/extract_blocks + /flexible_translate).

Media typeapplication/json
ITRPRenderRequest
object
image
required
Image

Base64-encoded image (JPEG or PNG)

string
blocks
required
Blocks

Pre-translated text blocks with positions

Array<object>
>= 1 items
ITRPRenderBlock
object
text
required
Text

Original text (used for bbox white-fill positioning)

string
translated
required
Translated

Translated text to render into the bbox

string
bbox
required
Bbox

Bounding box [x, y, width, height] in pixels

Array<number>
>= 4 items <= 4 items
target_lang
Target Lang

Target language code (for CJK font selection)

string
default: en >= 1 characters <= 20 characters

Successful Response

Media typeapplication/json
ITRPRenderResponse
object
rendered_image
required
Rendered Image

Base64 JPEG with translated text overlaid on the original image

string
Examplegenerated
{
"rendered_image": "example"
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}