<?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: kevinbai</title>
    <description>The latest articles on DEV Community by kevinbai (@kevinbai).</description>
    <link>https://dev.to/kevinbai</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3839666%2F5c2685ae-9dfe-4d39-a5c2-5e252b2e3f6b.jpg</url>
      <title>DEV Community: kevinbai</title>
      <link>https://dev.to/kevinbai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kevinbai"/>
    <language>en</language>
    <item>
      <title>I built an AI photo merging tool after a 20-minute Photoshop failure</title>
      <dc:creator>kevinbai</dc:creator>
      <pubDate>Mon, 08 Jun 2026 01:09:17 +0000</pubDate>
      <link>https://dev.to/kevinbai/i-built-an-ai-photo-merging-tool-after-a-20-minute-photoshop-failure-4hpa</link>
      <guid>https://dev.to/kevinbai/i-built-an-ai-photo-merging-tool-after-a-20-minute-photoshop-failure-4hpa</guid>
      <description>&lt;p&gt;A few months ago I had a group photo from a trip where one friend was missing — she'd left early. I opened Photoshop, spent 20 minutes fighting selection masks, and gave up. The result looked terrible.&lt;/p&gt;

&lt;p&gt;I figured: this is a problem with a clear solution. Someone should make it easy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validating before building
&lt;/h2&gt;

&lt;p&gt;Before writing a line of code, I went looking for evidence that other people hit this wall too.&lt;/p&gt;

&lt;p&gt;It didn't take long. Reddit threads, Quora questions, random Facebook groups — people asking how to add a family member who missed the reunion, how to combine two decent shots into one, how to put their kid next to a theme park character without actually going. Common, everyday problems that Photoshop technically solves but realistically doesn't — not for people without the time or skill to learn it.&lt;/p&gt;

&lt;p&gt;That felt like enough signal to start.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the product does
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aiimagecombiner.app" rel="noopener noreferrer"&gt;aiimagecombiner.app&lt;/a&gt; lets you upload 2–5 photos, add an optional text prompt to guide the composition, and get back a single blended image. No masking, no layers, no manual color matching.&lt;/p&gt;

&lt;p&gt;The use cases that keep coming up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding someone who wasn't in a group photo&lt;/li&gt;
&lt;li&gt;Combining product photos without a studio&lt;/li&gt;
&lt;li&gt;Before/after comparisons with matched tones&lt;/li&gt;
&lt;li&gt;Putting a subject into a different background scene&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The hardest part
&lt;/h2&gt;

&lt;p&gt;Getting the blend to look natural. Naively stitching images together fails immediately — the lighting is always slightly off, proportions don't match, edges are obvious. The prompt-guided generation approach helped a lot here, letting the model reinterpret the whole scene rather than just paste things together.&lt;/p&gt;

&lt;p&gt;Built on Next.js + Cloudflare Workers, moved fast with Claude Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell myself before starting
&lt;/h2&gt;

&lt;p&gt;The positioning language matters more than I expected. Users aren't searching for "AI image compositing" — they're searching for "how do I put two photos together." Getting that framing right took longer than it should have.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>design</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How AI Translates Manga: The Full Pipeline</title>
      <dc:creator>kevinbai</dc:creator>
      <pubDate>Mon, 23 Mar 2026 14:36:10 +0000</pubDate>
      <link>https://dev.to/kevinbai/how-ai-translates-manga-a-deep-dive-into-the-full-pipeline-2in6</link>
      <guid>https://dev.to/kevinbai/how-ai-translates-manga-a-deep-dive-into-the-full-pipeline-2in6</guid>
      <description>&lt;p&gt;Translating manga sounds simple — just read the text and translate it, right? In practice, it's one of the most technically demanding NLP + computer vision problems you can tackle. The text is embedded in images, stylized, often arranged vertically, and packed inside speech bubbles that need to look natural after translation.&lt;/p&gt;

&lt;p&gt;In this post I'll walk through the full AI pipeline behind automated manga translation — from raw image to a fully rendered, translated page.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Full Pipeline
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Input Image
    │
    ├─ [Optional] Upscaling
    ├─ 1. Text Detection
    ├─ 2. OCR
    ├─ 3. Textline Merge
    ├─ 4. Translation
    ├─ 5. Inpainting
    └─ 6. Rendering
         │
    Output Image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Six steps. Each one is a non-trivial problem on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pre-processing: Upscaling
&lt;/h2&gt;

&lt;p&gt;Small panels or low-DPI scans contain text that's only a few pixels tall. Running detection and OCR on 8px-high characters produces garbage. Super-resolution models like &lt;strong&gt;Waifu2x&lt;/strong&gt; — built specifically for anime/manga art — can 2x or 4x the resolution before anything else runs, dramatically improving downstream accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Text Detection
&lt;/h2&gt;

&lt;p&gt;The first challenge is finding &lt;em&gt;where&lt;/em&gt; text is. Manga text comes in every orientation, size, and style imaginable — axis-aligned bounding boxes aren't enough.&lt;/p&gt;

&lt;p&gt;Modern text detectors predict a &lt;strong&gt;pixel-level probability map&lt;/strong&gt; of "text-ness" across the entire image, then threshold and trace it into polygons. This produces arbitrarily-shaped regions that conform to rotated, curved, or irregularly laid-out text — something a simple rectangle detector can't handle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: OCR — Why Generic OCR Fails
&lt;/h2&gt;

&lt;p&gt;Standard OCR tools fail badly on manga. Stylized fonts, vertical text, low contrast against screentone backgrounds — none of this matches what Tesseract or cloud OCR was trained on.&lt;/p&gt;

&lt;p&gt;The solution is domain-specific models trained on manga panels. One example: &lt;strong&gt;MangaOCR&lt;/strong&gt;, a ViT-based model fine-tuned specifically on Japanese manga. Because it's seen thousands of speech bubbles during training, it handles stylized lettering and vertical text far better than any general-purpose OCR.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Textline Merge — A Graph Theory Problem
&lt;/h2&gt;

&lt;p&gt;Detection gives you individual text lines. But a single speech bubble might contain five detected lines that need to be treated as one block for translation.&lt;/p&gt;

&lt;p&gt;Merging by proximity alone fails — nearby lines from different bubbles get incorrectly grouped. The better approach: model it as a &lt;strong&gt;graph problem&lt;/strong&gt;. Each textline is a node; edges connect candidates weighted by distance, font size similarity, and alignment direction. Cut the graph at the right edges and the remaining connected components become coherent text blocks, ready for translation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Translation
&lt;/h2&gt;

&lt;p&gt;With clean text extracted, translation is where you have the most flexibility. You can plug in any API (GPT-4, DeepL, Gemini) or run local models (Meta's NLLB, which covers 200+ languages, or lighter models specialized for Japanese→English).&lt;/p&gt;

&lt;p&gt;One interesting pattern: &lt;strong&gt;chaining translators&lt;/strong&gt;. Route text through one model to get an intermediate language, then through a second model specialized in the final target language. Sometimes two mediocre steps beat one expensive one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Inpainting — Erasing the Original Text
&lt;/h2&gt;

&lt;p&gt;Before rendering the translation, the original text has to be erased and the background reconstructed. This is harder than it sounds — the model needs to hallucinate the screentone, hatching, or artwork that was hiding underneath.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LaMa&lt;/strong&gt; (Large Mask Inpainting) handles this well. Its large receptive field lets it understand the global structure of the image before deciding what to fill in — so it correctly continues a crosshatch pattern or background gradient across the erased region, rather than just blending nearby pixels.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: Rendering — The Hardest Part Nobody Talks About
&lt;/h2&gt;

&lt;p&gt;Most DIY translation tools fall flat here. Slapping text onto an image is trivial. Making it look like it belongs there is genuinely hard.&lt;/p&gt;

&lt;p&gt;A few of the problems the renderer has to solve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Length mismatch&lt;/strong&gt;: a 10-character Japanese phrase might translate to 40 English characters. The renderer must dynamically shrink the font, reflow the text, and keep it inside the bubble.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rotation&lt;/strong&gt;: dialogue in action panels is often tilted. The text layer is warped to match using a homography transform — the same math behind AR markers and image stitching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vertical text&lt;/strong&gt;: Japanese manga uses top-to-bottom columns. Simply rotating glyphs 90° doesn't produce correct vertical typography — specific characters have dedicated vertical variants that need to be substituted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting all three right simultaneously, for every panel on a page, is what separates a usable translation from a broken one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Without Setting Any of This Up
&lt;/h2&gt;

&lt;p&gt;Configuring the full stack — models, CUDA, dependencies, API keys — takes real effort. If you just want to see what this pipeline produces on your own manga pages, &lt;a href="https://mangatranslator.me" rel="noopener noreferrer"&gt;&lt;strong&gt;mangatranslator.me&lt;/strong&gt;&lt;/a&gt; runs it online without any local setup. Upload an image, pick a target language, done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Automated manga translation is a good example of how real-world AI applications are rarely about one model — they're about a sequence of specialized models where each step's output quality determines the ceiling of the next. The rendering step in particular is a reminder that "put text on image" hides a surprising amount of engineering.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>nlp</category>
      <category>ocr</category>
      <category>inpainting</category>
    </item>
  </channel>
</rss>
