<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: zeng</title>
    <description>The latest articles on DEV Community by zeng (@bin_zeng_24e2a56bb9ed4a91).</description>
    <link>https://dev.to/bin_zeng_24e2a56bb9ed4a91</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4133625%2F1a3b10b2-efcb-43c8-b2a7-72a2eb109752.jpg</url>
      <title>DEV Community: zeng</title>
      <link>https://dev.to/bin_zeng_24e2a56bb9ed4a91</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bin_zeng_24e2a56bb9ed4a91"/>
    <language>en</language>
    <item>
      <title>How Image Translation Actually Works: From Pixels to Translated Text</title>
      <dc:creator>zeng</dc:creator>
      <pubDate>Sun, 20 Sep 2026 03:13:42 +0000</pubDate>
      <link>https://dev.to/bin_zeng_24e2a56bb9ed4a91/how-image-translation-actually-works-from-pixels-to-translated-text-5dnh</link>
      <guid>https://dev.to/bin_zeng_24e2a56bb9ed4a91/how-image-translation-actually-works-from-pixels-to-translated-text-5dnh</guid>
      <description>&lt;p&gt;Translating text on a web page is easy. The browser already knows where the text is, what each sentence says, and how it should be displayed.&lt;/p&gt;

&lt;p&gt;Images are different.&lt;/p&gt;

&lt;p&gt;A screenshot, restaurant menu, product label, poster, or scanned document is just a collection of pixels. Before we can translate anything, we first need to figure out where the text is, recognize what it says, translate it, and somehow put the translated text back into the image.&lt;/p&gt;

&lt;p&gt;That makes image translation an interesting combination of computer vision, OCR, machine translation, and image generation.&lt;/p&gt;

&lt;p&gt;Step 1: Finding Text Inside the Image&lt;/p&gt;

&lt;p&gt;The first problem is text detection.&lt;/p&gt;

&lt;p&gt;An image may contain multiple text blocks with different fonts, sizes, colors, and orientations. Text can also appear on complex backgrounds, signs, packaging, screenshots, or photographs.&lt;/p&gt;

&lt;p&gt;A typical OCR pipeline first detects regions that are likely to contain text.&lt;/p&gt;

&lt;p&gt;Instead of seeing:&lt;/p&gt;

&lt;p&gt;Welcome to Tokyo&lt;br&gt;
Platform 3&lt;br&gt;
Exit A&lt;/p&gt;

&lt;p&gt;the system initially sees something closer to:&lt;/p&gt;

&lt;p&gt;[x1, y1, x2, y2]&lt;br&gt;
[x1, y1, x2, y2]&lt;br&gt;
[x1, y1, x2, y2]&lt;/p&gt;

&lt;p&gt;Each bounding box represents an area where text probably exists.&lt;/p&gt;

&lt;p&gt;Step 2: Recognizing the Text&lt;/p&gt;

&lt;p&gt;Once the text regions are detected, OCR converts the pixels inside those regions into characters.&lt;/p&gt;

&lt;p&gt;For clean screenshots, this can work extremely well.&lt;/p&gt;

&lt;p&gt;Real-world photos are harder.&lt;/p&gt;

&lt;p&gt;Some common problems include:&lt;/p&gt;

&lt;p&gt;blurry images&lt;/p&gt;

&lt;p&gt;low contrast&lt;/p&gt;

&lt;p&gt;decorative fonts&lt;/p&gt;

&lt;p&gt;rotated text&lt;/p&gt;

&lt;p&gt;shadows and reflections&lt;/p&gt;

&lt;p&gt;curved product packaging&lt;/p&gt;

&lt;p&gt;mixed languages&lt;/p&gt;

&lt;p&gt;This is why image quality still matters even with modern AI models.&lt;/p&gt;

&lt;p&gt;Step 3: Translating the Content&lt;/p&gt;

&lt;p&gt;After OCR, the recognized text can be sent to a translation model.&lt;/p&gt;

&lt;p&gt;At this stage, context becomes important.&lt;/p&gt;

&lt;p&gt;Imagine translating a menu containing:&lt;/p&gt;

&lt;p&gt;Cold Brew&lt;br&gt;
House Special&lt;br&gt;
Market Price&lt;/p&gt;

&lt;p&gt;Translating each phrase independently may produce technically correct results, but the wording can feel unnatural.&lt;/p&gt;

&lt;p&gt;Modern translation systems can use surrounding text and context to produce better results.&lt;/p&gt;

&lt;p&gt;Language detection is also useful here. Instead of asking the user to manually select both the source and target language, the application can detect the source language automatically and only ask where the text should be translated.&lt;/p&gt;

&lt;p&gt;Step 4: Putting the Translation Back Into the Image&lt;/p&gt;

&lt;p&gt;This is probably the most interesting part.&lt;/p&gt;

&lt;p&gt;Returning translated text as plain text is easy.&lt;/p&gt;

&lt;p&gt;Producing a translated image is much harder.&lt;/p&gt;

&lt;p&gt;The system needs to remove or cover the original text and place the translated version in approximately the same location while considering:&lt;/p&gt;

&lt;p&gt;text size&lt;/p&gt;

&lt;p&gt;line wrapping&lt;/p&gt;

&lt;p&gt;alignment&lt;/p&gt;

&lt;p&gt;background&lt;/p&gt;

&lt;p&gt;spacing&lt;/p&gt;

&lt;p&gt;surrounding visual elements&lt;/p&gt;

&lt;p&gt;Different languages can also have dramatically different text lengths.&lt;/p&gt;

&lt;p&gt;A short English phrase may become a much longer sentence in German, while several Chinese characters may translate into multiple English words.&lt;/p&gt;

&lt;p&gt;The goal is therefore not pixel-perfect reconstruction. It is preserving enough of the original visual context that the translated image remains easy to understand.&lt;/p&gt;

&lt;p&gt;Why This Is Useful&lt;/p&gt;

&lt;p&gt;There are many situations where keeping the translation inside the image is more useful than extracting plain text.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;translating restaurant menus while traveling&lt;/p&gt;

&lt;p&gt;reading screenshots from international communities&lt;/p&gt;

&lt;p&gt;understanding product labels&lt;/p&gt;

&lt;p&gt;translating posters and notices&lt;/p&gt;

&lt;p&gt;reading foreign-language study materials&lt;/p&gt;

&lt;p&gt;translating UI screenshots&lt;/p&gt;

&lt;p&gt;sharing translated images with other people&lt;/p&gt;

&lt;p&gt;You can immediately see which translated sentence corresponds to which part of the original image.&lt;/p&gt;

&lt;p&gt;I Built a Small Tool Around This Idea&lt;/p&gt;

&lt;p&gt;I recently experimented with this workflow and built &lt;a href="https://www.picturetranslator.com/" rel="noopener noreferrer"&gt;PictureTranslator.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The idea is intentionally focused: upload an image, choose a target language, and receive a translated version of the image.&lt;/p&gt;

&lt;p&gt;It currently works with common formats such as JPG, PNG, and WebP, automatically detects the source language, and lets you compare the translated result with the original.&lt;/p&gt;

&lt;p&gt;I wanted the interaction to stay lightweight because image translation is often something you need for a single screenshot, sign, menu, or document and then move on.&lt;/p&gt;

&lt;p&gt;It has also been a fun example of how AI can turn several traditionally separate tasks—OCR, translation, layout understanding, and image editing—into one small web workflow.&lt;/p&gt;

&lt;p&gt;If you're experimenting with OCR, multimodal AI, or translation tools, image translation is a surprisingly interesting problem to explore.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>machinelearning</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
