Skip to main content
During layer decomposition, Seedream 5.5 can return rich-text OCR results for regular text layers: the text, the position of each line and approximate visual styles. Design tools and applications can combine this data with the decomposed layers to change copy, localize content and reuse templates. Editing the text and compositing the layers is done by your tool or application. Seedream 5.5 decomposition returns a base image, independent layers, and OCR results for regular text so applications can edit text Watch the demo video

Example

The example decomposes a poster and obtains the OCR results of its text layers. The request sets max_images: 15 and returns 13 images: one base image and 12 layers, nine of which are text layers with OCR results.
Download the official full example package (ZIP, about 6.7 MB) with the input poster, the base image, all layers, the OCR data and an interactive page: extract it keeping the directory structure, open seedream-55-ocr-preview.html in a browser and select a text layer to inspect the text, coordinates and styles of each line and preview changes to the text, colors and bold styling.

Enable OCR

In a layer decomposition request, set both:
  • layer_decomposition: true to enable layer decomposition;
  • layer_decomposition_options.text_recognition: true to request OCR results for regular text layers.

OCR response fields

The OCR result of a text layer is returned in data[].text_recognition: the complete plain text, plus positions, text and styles organized by text lines and style runs.

Text-layer response example

The data[] item of the text layer containing Presented By : and Anna Katrina Marchesi in the example above (z_index: 6).

Limitations

  • Recognition coverage: only regular text layers return OCR results; see OCR supported fonts for the fonts that can be recognized. Base images, non-text layers, artistic text and handwritten text do not return text_recognition.
  • Font recognition: similar_font_family is an approximate match and is not guaranteed to equal the original font. It returns unknown when recognition is unavailable or confidence is insufficient.
  • Style recognition: style information is approximate; false means the model did not recognize the style.
  • OCR does not change billing: the request is still billed by the images returned; see Fine-grained layer decomposition.