<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Anime Star Eyes Blog]]></title><description><![CDATA[Anime Star Eyes Blog]]></description><link>https://animestareyes.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 01 Nov 2026 23:18:58 GMT</lastBuildDate><atom:link href="https://animestareyes.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How AI Anime Filters Work: Face and Eye Localisation, Style Transfer, and Why Single-Eye Edits Are Hard]]></title><description><![CDATA[A maker's tour of the building blocks behind anime selfie effects, and the engineering problems that make "just change one eye" surprisingly tricky]]></description><link>https://animestareyes.hashnode.dev/how-ai-anime-filters-work-face-and-eye-localisation-style-transfer-and-why-single-eye-edits-are-hard</link><guid isPermaLink="true">https://animestareyes.hashnode.dev/how-ai-anime-filters-work-face-and-eye-localisation-style-transfer-and-why-single-eye-edits-are-hard</guid><category><![CDATA[Computer Vision]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[image processing]]></category><category><![CDATA[generative ai]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Anime Star Eyes]]></dc:creator><pubDate>Sat, 31 Oct 2026 13:27:30 GMT</pubDate><content:encoded><![CDATA[<p>Anime selfie filters look simple from the outside: upload a photo, get a stylised one back. Underneath, even a small effect like replacing <em>one</em> eye with an anime eye involves a chain of computer vision steps, and each one has edge cases.</p>
<p>This post covers the general techniques used for this kind of effect. A disclaimer first: I have no knowledge of how any particular commercial product is built. When I mention a product, it is only an example of the kind of output being discussed. Everything below is a general description of public, well-known approaches.</p>
<h2>The two families of anime filters</h2>
<p>Broadly, there are two kinds of anime effect:</p>
<ol>
<li><strong>Whole-image stylisation.</strong> The entire photo is converted into an anime look: flat shading, strong outlines, simplified colour. Classic examples are image-to-image GANs such as <a href="https://github.com/TachibanaYoshino/AnimeGANv2">AnimeGANv2</a> (with a popular <a href="https://github.com/bryandlee/animegan2-pytorch">PyTorch port</a>) and one-shot face stylisation methods like <a href="https://github.com/mchong6/JoJoGAN">JoJoGAN</a>.</li>
<li><strong>Localised, mixed-media edits.</strong> Most of the photo stays real, and only one region is changed. The "anime star eye" trend is a good example: one eye becomes a drawn anime eye with a star, heart or manga-ink look, and the rest of the face stays photographic. <a href="https://animeselfie.com/">Anime Star Eyes (animeselfie.com)</a> is one product built around this format. It takes one adult selfie, replaces one eye, adds original "anime twin" character stickers and returns a 2K 9:16 image.</li>
</ol>
<p>The second family sounds easier, since you only change a small area. In practice, it brings its own set of problems.</p>
<h2>Step 1: Find the face</h2>
<p>Everything starts with face detection: a bounding box (or several) around faces in the image. Modern detectors are fast and robust, but a production pipeline still has to decide what to do with:</p>
<ul>
<li><strong>No face</strong> (a pet, a landscape, a heavily cropped shot)</li>
<li><strong>Multiple faces</strong>: which one gets edited?</li>
<li><strong>Tiny faces</strong> in a wide shot, where the eye is only a few pixels wide</li>
<li><strong>Extreme poses</strong>, where one eye is barely visible</li>
</ul>
<p>Many consumer tools sidestep part of this with input rules: one person, face clearly visible, size and format limits. Those rules are not just bureaucracy. They narrow the input distribution so later stages behave predictably.</p>
<h2>Step 2: Localise the eyes precisely</h2>
<p>A bounding box is not enough to edit an eye. You need <strong>facial landmarks</strong>: dense keypoints around the eyelids, iris, brows and so on. Libraries such as Google's <a href="https://ai.google.dev/edge/mediapipe/solutions/vision/face_landmarker">MediaPipe Face Landmarker</a> produce hundreds of 3D landmarks and head-pose estimates in real time, which gives you:</p>
<ul>
<li>The eye contour (to build a mask)</li>
<li>The iris centre (to place a pupil or highlight)</li>
<li>Head yaw, pitch and roll (to warp a flat anime eye so it matches the face's angle)</li>
</ul>
<p>Landmarks get unreliable with glasses (reflections and frames), hair over the eye, heavy makeup that changes the apparent lid line, and blinking or squinting. This is why almost every guide for these filters tells you to take off glasses and keep the eyes clear.</p>
<h2>Step 3: Decide <em>how</em> to change the eye</h2>
<p>There are roughly three strategies, each with trade-offs.</p>
<p><strong>A. Template compositing.</strong> Take a pre-drawn anime eye asset, warp it to the landmark geometry, and blend it in. This is predictable and fast, but it can look "stickered on" because the lighting, colour and scale never quite match the photo.</p>
<p><strong>B. Global style transfer, then masking.</strong> Run a stylisation model on the whole face (see <a href="https://en.wikipedia.org/wiki/Neural_style_transfer">neural style transfer</a> for the general idea), then keep only the eye region using a mask. It is easy to build, but whole-image models are trained to stylise <em>everything</em> consistently. Cut out a single region, and the seam between styled and unstyled pixels is often obvious.</p>
<p><strong>C. Masked generative inpainting.</strong> Mask the eye region and ask a conditional generative model to fill it with an anime-style eye that fits the surrounding pixels. This can produce the most natural blends, but it is harder to control: the model may drift on identity, change the wrong eye, or produce an eye that does not match the requested motif (star versus heart).</p>
<p>Real systems often mix these: generative fill for the blend, plus constraints or references to keep the motif consistent.</p>
<h2>Why a single-eye edit is genuinely hard</h2>
<p>Changing one eye breaks several assumptions that whole-image filters rely on.</p>
<h3>1. Symmetry is now a bug, not a feature</h3>
<p>Face models learn that left and right eyes are similar. If you ask a generative model to stylise one eye, it often "leaks" the style into the other eye, or pulls the edited eye back towards realism. You need a tight mask and strong conditioning to keep the asymmetry.</p>
<h3>2. Two rendering styles have to meet on one face</h3>
<p>The seam between a photographic eyelid and a flat, ink-outlined anime eye sits right on a high-attention area. People are extremely sensitive to anything odd around eyes. Feathering the mask helps, but too much feathering produces a muddy halo. Too little, and you get a hard cut-out edge. Some looks, such as manga screentone, deliberately keep a graphic edge, which is a design choice that hides the seam by owning it.</p>
<h3>3. Scale and perspective</h3>
<p>Anime eyes are stylistically <em>oversized</em>. The edit has to be bigger than the real eye without covering the brow or nose in a weird way, and it has to follow the head's rotation. A frontal eye pasted onto a three-quarter face looks wrong immediately.</p>
<h3>4. Lighting consistency</h3>
<p>The real half of the face has a specific light direction and colour temperature. A convincing anime eye needs highlights that roughly agree with it, even though anime highlights are stylised (stars, hearts, sparkles).</p>
<h3>5. Identity preservation</h3>
<p>The whole appeal of the mixed-media look is that it is still recognisably you. Any generative step that touches the face risks subtly changing the nose, skin or expression. Keeping edits local and the mask tight is the main defence.</p>
<h2>Extras: generated characters and output format</h2>
<p>Some products go beyond the eye. Generating a separate chibi-style "twin" character from the photo is a different task: it is closer to reference-guided character generation than editing, using cues like hair colour, outfit and accessories. Layout then becomes a composition problem: place stickers without covering the face.</p>
<p>Output format matters too. Social apps are vertical, so producing a fixed 9:16 frame at decent resolution (for example 2K) avoids a lossy crop and re-upload later.</p>
<h2>Product-level concerns makers should not skip</h2>
<p>If you are building something like this yourself:</p>
<ul>
<li><strong>Restrict inputs</strong> (one person, clear face, sane file sizes and formats) to cut failure cases.</li>
<li><strong>Treat face images as sensitive data.</strong> Private by default should be the baseline.</li>
<li><strong>Add safety checks and age gating.</strong> Face-editing tools are easy to misuse on other people's photos. Animeselfie.com, for example, states its service is 18+ only.</li>
<li><strong>Handle failures gracefully.</strong> Detection and generation will sometimes fail, so decide what the user experience and billing look like when they do.</li>
</ul>
<h2>Wrapping up</h2>
<p>"Change one eye to an anime eye" combines face detection, landmark localisation, pose-aware warping, masked generation and careful blending, all aimed at the region of the face humans scrutinise most. If you want to experiment, the open-source projects linked above are good starting points. If you want to see what a finished, single-purpose version of the idea looks like, <a href="https://animeselfie.com/">an AI star, heart and manga eye selfie tool like AnimeSelfie</a> is a useful reference for the target output.</p>
]]></content:encoded></item></channel></rss>