Itrp Render
const url = 'https://example.com/itrp/render';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"image":"example","blocks":[{"text":"example","translated":"example","bbox":[1]}],"target_lang":"en"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Base64-encoded image (JPEG or PNG)
Pre-translated text blocks with positions
object
Original text (used for bbox white-fill positioning)
Translated text to render into the bbox
Bounding box [x, y, width, height] in pixels
Target language code (for CJK font selection)
Responses
Section titled “Responses”Successful Response
object
Base64 JPEG with translated text overlaid on the original image
Examplegenerated
{ "rendered_image": "example"}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}