<?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: li wujie</title>
    <description>The latest articles on DEV Community by li wujie (@li_wujie_0995d9c1bca1f2e3).</description>
    <link>https://dev.to/li_wujie_0995d9c1bca1f2e3</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%2F3353234%2Fd4807eca-1c2f-4e84-a4ab-801dcb66d923.png</url>
      <title>DEV Community: li wujie</title>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/li_wujie_0995d9c1bca1f2e3"/>
    <language>en</language>
    <item>
      <title>Replacing Text in an Image Without Breaking Its Typography</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Sat, 05 Dec 2026 02:32:02 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/replacing-text-in-an-image-without-breaking-its-typography-1lg1</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/replacing-text-in-an-image-without-breaking-its-typography-1lg1</guid>
      <description>&lt;p&gt;If you have ever needed to change a price on a product photo, fix a typo on a menu someone photographed, or localize a poster, you already know the annoying part is not the text itself. The annoying part is that the image around the text has to keep looking untouched, and the new text has to keep looking like it was always there.&lt;/p&gt;

&lt;p&gt;I have spent a lot of time on this problem while building &lt;a href="https://editimagetext.org" rel="noopener noreferrer"&gt;EditImageText&lt;/a&gt;, a browser tool that replaces text inside images. This post is a walkthrough of the pipeline, the parts that are genuinely hard, and the cheap tricks that make a fake look instantly fake.&lt;/p&gt;

&lt;h2&gt;
  
  
  The naive approach and why it fails
&lt;/h2&gt;

&lt;p&gt;The naive approach is: draw a filled rectangle over the old text, then draw new text on top.&lt;/p&gt;

&lt;p&gt;It fails for four separate reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The background is not a flat color. Even a "white" product photo has a gradient, vignetting, and JPEG noise. A flat rectangle is visible immediately.&lt;/li&gt;
&lt;li&gt;The new text rarely matches the font. Different x-height, different stroke contrast, different terminals.&lt;/li&gt;
&lt;li&gt;Tracking and kerning differ, so the line either crowds or gaps.&lt;/li&gt;
&lt;li&gt;The compositing is off: the new glyphs are perfectly clean, while everything around them carries film grain, JPEG ringing, or screenshot scaling blur.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Fixing reason 1 is inpainting. Fixing reasons 2 and 3 is style estimation. Fixing reason 4 is matching the noise floor of the source image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: finding the text
&lt;/h2&gt;

&lt;p&gt;Text detection is the easy part now. An OCR pass gives you line boxes, and from those boxes you get glyph clusters. What matters for the next steps is not the recognized string but the geometry:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the bounding box of each line&lt;/li&gt;
&lt;li&gt;cap height and x-height&lt;/li&gt;
&lt;li&gt;baseline position&lt;/li&gt;
&lt;li&gt;the average stroke width&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A decent sanity check: &lt;code&gt;stroke_width / cap_height&lt;/code&gt; is close to constant for a given weight. If you measure 0.12 the source is Regular or Medium; 0.16 or above and you are looking at Bold. Getting this ratio wrong by one weight is the single most common reason a replacement looks wrong even when the font family is correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: inpainting the background
&lt;/h2&gt;

&lt;p&gt;Dilate the text mask by a few pixels, because antialiasing has already leaked the glyph color into the surrounding pixels. Then inpaint.&lt;/p&gt;

&lt;p&gt;Classic inpainting (telea, navier-stokes) works fine on flat regions and dies on textured ones. For photographed menus and product shots you want something that understands texture, which in practice means a diffusion model with a mask. The important trick is resolution: inpainting at the original resolution preserves grain and keeps the patch consistent with the surroundings, while up-and-down scaling gives you a visibly smoother patch.&lt;/p&gt;

&lt;p&gt;If you can avoid inpainting entirely, do. Screenshots with flat UI backgrounds are trivially recoverable by copying a neighboring row of pixels, and that is always better than a synthesized patch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: estimating the font
&lt;/h2&gt;

&lt;p&gt;You cannot reliably identify the exact font from a rasterized line, but you do not need to. You need a font whose metrics match closely enough:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Family class.&lt;/strong&gt; Serif vs sans vs mono is decided by the stroke terminals, not by the overall look.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Width.&lt;/strong&gt; Compare the measured advance width per character against candidate fonts rendered at the same cap height. The lowest error candidate wins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optical weight.&lt;/strong&gt; Estimate a further weight search: render the candidate at Regular, Medium, Semibold, Bold and pick the minimum stroke-width error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Letter spacing.&lt;/strong&gt; After family and weight are fixed, the residual error per character is almost entirely tracking. Fit a single tracking value by least squares over the line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One subtlety: cap height is not line height. If you set the font size from the line box, the glyphs come out too small. Set it from cap height and then position the baseline explicitly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: rendering and compositing
&lt;/h2&gt;

&lt;p&gt;Before drawing, match the color. Sample the glyph interior pixels (erode the mask first to drop antialiased edges), then take the median, not the mean — a single dark outlier pixel will drag a mean noticeably.&lt;/p&gt;

&lt;p&gt;Then:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;render at 2x and downsample, so glyph edges have the same antialiasing profile as the rest of the image&lt;/li&gt;
&lt;li&gt;apply the same rotation as the source line; photographed text is rarely axis-aligned&lt;/li&gt;
&lt;li&gt;composite with the alpha profile of the surrounding noise, so a heavy JPEG source produces slightly soft glyph edges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A trick that gets underestimated: add back a fraction of the source image's high-frequency noise to the newly drawn glyphs. Clean glyphs on a noisy background read as pasted, even when nothing else is wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: keeping the image honest
&lt;/h2&gt;

&lt;p&gt;Two properties break real workflows more often than the visual quality:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Aspect ratio.&lt;/strong&gt; Inserting a longer string into a fixed-width box either shrinks the text or overflows it. Shrinking changes the optical weight and looks wrong. The right approach is to constrain the layout box and adjust tracking within a reasonable range before touching size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Metadata.&lt;/strong&gt; If the source is a screenshot, keep PNG. Re-encoding to JPEG to "save size" destroys exactly the noise profile you just matched, and any further edit will look worse. If the source is a photo, preserve the EXIF orientation and DPI; some pipelines will silently rotate an image whose orientation tag got dropped.&lt;/p&gt;

&lt;h2&gt;
  
  
  A checklist I use
&lt;/h2&gt;

&lt;p&gt;Before calling an edit done:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Zoom to 200% and compare the noise level of the new text to the old text.&lt;/li&gt;
&lt;li&gt;Check cap height against a neighboring line, not against the line box.&lt;/li&gt;
&lt;li&gt;Look at the space between words — tracking errors show up there before anywhere else.&lt;/li&gt;
&lt;li&gt;Check the inpainting seam at full resolution.&lt;/li&gt;
&lt;li&gt;Verify the image is not resized after compositing.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Where this lives today
&lt;/h2&gt;

&lt;p&gt;The pipeline above is what &lt;a href="https://editimagetext.org" rel="noopener noreferrer"&gt;EditImageText&lt;/a&gt; runs in the browser: upload a screenshot, poster, menu or product photo, replace the text, download the result with the original font, lighting and aspect ratio preserved. Sign in with Google for two free credits, and if you need more, one-time credit packs — no subscription.&lt;/p&gt;

&lt;p&gt;If you are building something similar, the two changes with the highest return are matching stroke width before font family, and adding the source noise back to new glyphs. Both are cheap, and both fix the "this looks pasted" reaction immediately.&lt;/p&gt;

</description>
      <category>design</category>
      <category>software</category>
      <category>tools</category>
    </item>
    <item>
      <title>Counting Down to a Fixed Date in Local Time: Four Timezone Traps Behind a One-Line Countdown</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Sat, 05 Dec 2026 02:17:58 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/counting-down-to-a-fixed-date-in-local-time-four-timezone-traps-behind-a-one-line-countdown-45kl</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/counting-down-to-a-fixed-date-in-local-time-four-timezone-traps-behind-a-one-line-countdown-45kl</guid>
      <description>&lt;p&gt;Every year, around this time, search volume for "how many days until Valentine's Day" spikes, and every year a large share of the answers are off by one for somebody. It looks like a one-liner problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;days&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;86_400_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That line is wrong in at least four different ways. I build &lt;a href="https://daysuntilvalentinesday.com" rel="noopener noreferrer"&gt;daysuntilvalentinesday.com&lt;/a&gt;, a small countdown page, and these are the traps I actually hit while making the number correct for visitors in every timezone.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "How many days" is a calendar question, not a duration question
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;(target - now) / 86400000&lt;/code&gt; gives an elapsed duration in days. Users do not want that. If it is 23:00 on February 12 in Tokyo, the honest answer is "1 day", even though only about 12 hours remain until local midnight on the 14th. If it is 01:00 on February 14, the answer is "0 days, it is today".&lt;/p&gt;

&lt;p&gt;So the calculation has to happen on calendar dates in the visitor's timezone, not on timestamps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;daysBetweenLocalDates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetMonth&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetDay&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeZone&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Intl&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;DateTimeFormat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'en-CA'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;timeZone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'numeric'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;month&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'2-digit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;day&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'2-digit'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'-'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UTC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// the target may already have passed this year: roll forward&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UTC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;year&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetMonth&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetDay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;UTC&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;year&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetMonth&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;targetDay&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;today&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;86_400_000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The trick is &lt;code&gt;Date.UTC&lt;/code&gt; on the &lt;em&gt;date parts only&lt;/em&gt;. Once both sides are midnight-UTC of a calendar date, the subtraction is exactly &lt;code&gt;n * 86400000&lt;/code&gt; regardless of DST, and rounding is safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. DST breaks any assumption about day length
&lt;/h2&gt;

&lt;p&gt;Doing the calibration in local time (&lt;code&gt;new Date(y, m - 1, d)&lt;/code&gt;) looks cleaner and is a trap: on a spring-forward day that local midnight is 23 hours after the previous one, so a difference of 3 calendar days can measure 71 hours and &lt;code&gt;Math.ceil&lt;/code&gt; silently becomes 4. Calendar arithmetic in UTC and timezone-aware formatting for display is the only combination I found that stays correct across DST boundaries, half-hour offsets (Asia/Kolkata) and 45-minute ones (Asia/Kathmandu).&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The target instant is local, not UTC
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;new Date('2027-02-14T00:00:00Z')&lt;/code&gt; is February 13 for anyone west of Greenwich. If the countdown is meant for the visitor's own midnight, never construct the target from a UTC string; construct it from the target month and day and let &lt;code&gt;Intl.DateTimeFormat&lt;/code&gt; decide what "today" means locally.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. February 29 exists
&lt;/h2&gt;

&lt;p&gt;If the target ever lands on a leap day, &lt;code&gt;Date.UTC(year, 1, 29)&lt;/code&gt; in a non-leap year silently becomes March 1. I validate the round-trip (&lt;code&gt;getUTCMonth() === expectedMonth&lt;/code&gt;) and clamp instead of trusting the constructor.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part nobody warns you about: the calendar file
&lt;/h2&gt;

&lt;p&gt;A countdown page is a five-second visit. The useful artifact is a recurring &lt;code&gt;.ics&lt;/code&gt; entry so the reminder arrives every year without anyone remembering the URL. Two details matter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BEGIN:VEVENT
DTSTART;VALUE=DATE:20270214
DTEND;VALUE=DATE:20270215
RRULE:FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=14
SUMMARY:Valentine's Day
END:VEVENT
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;All-day events use &lt;code&gt;VALUE=DATE&lt;/code&gt; with an exclusive &lt;code&gt;DTEND&lt;/code&gt;; a one-day event therefore ends on the 15th.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;FREQ=YEARLY&lt;/code&gt; with &lt;code&gt;BYMONTH&lt;/code&gt;/&lt;code&gt;BYMONTHDAY&lt;/code&gt; is more robust than &lt;code&gt;INTERVAL=1&lt;/code&gt;, because some clients anchor recurrence on the original weekday.&lt;/li&gt;
&lt;li&gt;No &lt;code&gt;VTIMEZONE&lt;/code&gt; block for all-day events — a calendar date is already timezone-free, and adding a TZID is how you get off-by-one reminders.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I actually ship
&lt;/h2&gt;

&lt;p&gt;The site is deliberately small, but each piece comes from one of the bugs above: a live timer (so the answer is not stale after a page is left open), the number of weekends left (people plan around weekends, not days), a yearly &lt;code&gt;.ics&lt;/code&gt; download for calendar alerts, and a four-week planning checklist. Everything is client-side and timezone-aware — the countdown recomputes when a visitor's timezone or system clock changes rather than trusting the value baked in at build time.&lt;/p&gt;

&lt;p&gt;If you are building anything date-relative — an advent calendar, a tax deadline page, a "days until launch" widget — the ordering that saved me the most bug reports was: compute in calendar dates, render in the visitor's timezone, and never trust a duration to mean a number of days.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Two-way image conversion: what I learned shipping photo-to-sketch and sketch-to-photo</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Fri, 04 Dec 2026 02:24:13 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/two-way-image-conversion-what-i-learned-shipping-photo-to-sketch-and-sketch-to-photo-1mfc</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/two-way-image-conversion-what-i-learned-shipping-photo-to-sketch-and-sketch-to-photo-1mfc</guid>
      <description>&lt;p&gt;Sketch To is a small web app with two buttons that look symmetric and turned out to be nothing alike: &lt;strong&gt;photo → sketch&lt;/strong&gt; and &lt;strong&gt;sketch → photo&lt;/strong&gt;. One is a stylisation problem, the other is an inverse problem with far less information in the input. Shipping both from the same codebase taught me a handful of lessons that had nothing to do with model quality, and everything to do with product plumbing.&lt;/p&gt;

&lt;p&gt;These are the notes I wish I had before starting. The app is &lt;a href="https://www.sketchto.com" rel="noopener noreferrer"&gt;sketchto.com&lt;/a&gt; if you want to poke at the result, but the interesting parts are the decisions below and you can copy those into a very different product.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two directions are not symmetric
&lt;/h2&gt;

&lt;p&gt;Stylising a photo means throwing information away in a controlled way: you start from a dense, well-lit, noisy input, and you ask the model for pencil, charcoal, ink, colored pencil, comic, concept, figure, watercolor or digital sketch looks. Prompting here is mostly about &lt;em&gt;reduction&lt;/em&gt; — what to drop, what to keep, and how the line weight should behave.&lt;/p&gt;

&lt;p&gt;Going the other way is the hard one. A pencil sketch is 5% of the pixels a photo has, so the model has to hallucinate the rest. Any product decision you make about prompts has to admit that: you cannot "fix" a sparse sketch with better instructions, you can only give the model more guidance and a better tier.&lt;/p&gt;

&lt;p&gt;The practical consequence: the two directions need different models, different credit costs and different expectations in the UI. If you build one "convert" endpoint and try to hide the difference, you will spend months explaining why one direction is slow and occasionally wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Style presets are data, not prompts in your controller
&lt;/h2&gt;

&lt;p&gt;The first refactor that paid for itself was moving every style out of the request handler and into a versioned table of presets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a stable id (&lt;code&gt;pencil&lt;/code&gt;, &lt;code&gt;charcoal&lt;/code&gt;, &lt;code&gt;watercolor&lt;/code&gt;, ...)&lt;/li&gt;
&lt;li&gt;the model-facing prompt fragments&lt;/li&gt;
&lt;li&gt;a default model tier&lt;/li&gt;
&lt;li&gt;a credit cost&lt;/li&gt;
&lt;li&gt;a thumbnail&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once presets are rows, three things become trivial: showing a style picker without hardcoding an array, A/B testing a prompt fragment on a subset of users, and deprecating a preset without breaking old generations. Old generations keep the preset &lt;em&gt;version&lt;/em&gt; they were produced with, which makes "why does this look different now" a one-query answer instead of an archaeology project.&lt;/p&gt;

&lt;p&gt;The mistake to avoid is storing prompts as prose in your repository and interpolating user input into them. You want a preset to be an immutable object with an id, and a custom-prompt escape hatch that is clearly a different code path.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Quote the price before you call the model
&lt;/h2&gt;

&lt;p&gt;Credits are the only thing users complain about louder than latency. The fix that removed most of the complaints was splitting generation into &lt;strong&gt;quote&lt;/strong&gt; and &lt;strong&gt;settle&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client asks "what would this cost?" and gets back a number from the same table the server will use.&lt;/li&gt;
&lt;li&gt;The user confirms.&lt;/li&gt;
&lt;li&gt;The server decrements credits, records a generation row, and calls the model.&lt;/li&gt;
&lt;li&gt;If the call fails before producing anything, a refund path puts the credits back and marks the row failed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The shape of the check that matters is boring on purpose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Quote&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;preset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"standard"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="s2"&gt;"pro"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;credits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;quote&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;preset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Preset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Tier&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Quote&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;credits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;preset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;costByTier&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;credits&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;credits&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`unpriced preset: ${preset.id}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;preset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;preset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tier&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;credits&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// single choke point: nothing else may call the model&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Quote&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;row&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;reserveCredits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;credits&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// throws when short&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;callModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;commitGeneration&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;releaseReservation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two details are load-bearing. First, &lt;code&gt;quote()&lt;/code&gt; and the charge both read &lt;code&gt;preset.costByTier&lt;/code&gt;, so the price the user saw cannot drift from the price they pay. Second, reservations are rows, not in-memory sets — if the process dies mid-generation you can reconcile instead of guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Tier the models, and be explicit about what the tier buys
&lt;/h2&gt;

&lt;p&gt;A single "best model" button is a bad experience and a worse business. Users on a hobby project do not want to pay pro prices for a social media post, and professionals do not want to be told the cheap tier is fine.&lt;/p&gt;

&lt;p&gt;What worked was making the tier visible in the output itself: the cheap tier is fast and good enough for drafts, the pro tier is slower and noticeably better at detail, texture and realism. Showing the credit cost &lt;em&gt;before&lt;/em&gt; every run ("2 credits") plus the resulting difference side by side did more for conversion than any copy we wrote.&lt;/p&gt;

&lt;p&gt;The engineering cost of this is that your model layer needs a stable interface across providers with very different parameter names, and a normalised error model. Write that adapter on day one; retrofitting it after you support three providers is a week of unhappy work.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Normalise the input, or your errors are un-debuggable
&lt;/h2&gt;

&lt;p&gt;Most "the model produced garbage" reports were actually "the input was a 12 MB HEIC with EXIF rotation and an alpha channel". Do the boring work in the browser before upload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;maxSide&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2048&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bmp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createImageBitmap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// applies EXIF orientation&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;maxSide&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;OffscreenCanvas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"2d"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"#fff"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;      &lt;span class="c1"&gt;// opaque base: alpha breaks some pipelines&lt;/span&gt;
  &lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bmp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convertToBlob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"image/jpeg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;quality&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.92&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;createImageBitmap&lt;/code&gt; applies EXIF rotation for you, the white base kills transparency, and capping the long side at 2048 keeps uploads small without visibly hurting a sketch conversion. Since this change went in, "bad result" reports became reproducible.&lt;/p&gt;

&lt;p&gt;On the server, store the normalised input next to the output. When someone asks why a conversion looks off, you want to compare against exactly what the model saw, not against a URL that may have been replaced.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. The comparison UI is the product
&lt;/h2&gt;

&lt;p&gt;For a two-way converter, the single most valuable UI element is a drag-to-compare slider between input and output. It is also the easiest place to introduce a subtle bug: if you render both images from the same cache key, the browser will show you a stale result and you will spend an hour blaming the model.&lt;/p&gt;

&lt;p&gt;Two rules fixed it for us:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;every output has an immutable id in its URL; never reuse a path for a regenerated image&lt;/li&gt;
&lt;li&gt;the slider works on already-decoded images, and the "before" is the normalised input actually sent, not the original file&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Adjacent tools are the cheapest retention feature
&lt;/h2&gt;

&lt;p&gt;Background removal, upscaling and uncrop are not the reason people sign up. They are the reason people come back between conversions. They share the same upload, credit and history plumbing, so each one costs very little to add once the pipeline exists — and they give the credit balance a second use, which is what makes a credit pack a reasonable purchase instead of a weird coin.&lt;/p&gt;

&lt;p&gt;The trap is scope: an "also useful" tool needs a quality bar close to the main feature, or it drags the whole product's perceived quality down. Ship fewer, and only where the same infrastructure applies.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Price for occasional use
&lt;/h2&gt;

&lt;p&gt;This is the decision I would defend hardest. A lot of image tools force a subscription, which is a bad deal for someone who needs three sketches a month. We ended up with three ways to pay: free trial credits on signup with no card, one-time credit packs that stay valid for a year with no auto-renewal, and a subscription (Basic $7.99/mo, Pro $15.99/mo) for people who need volume and a commercial licence.&lt;/p&gt;

&lt;p&gt;Offering a one-time pack next to a subscription is not a growth hack, it is an honesty fix: the pack removes the "I will forget to cancel" objection, and the people who actually use the product daily still pick the subscription. The only engineering requirement is that credits from packs, subscriptions and trials are distinguishable in your ledger, with expiry rules that are visible in the UI rather than hidden in a help article.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do differently
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start with the adapter.&lt;/strong&gt; One interface for all providers, from the first provider.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make presets rows immediately.&lt;/strong&gt; Even with four styles. Especially with four styles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log the normalised input, always.&lt;/strong&gt; Storage is cheaper than debugging.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build the compare view before the gallery.&lt;/strong&gt; It is what convinces people the product works.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is exotic. Two-way image conversion is mostly an exercise in refusing to treat the two directions as the same problem, and in making cost, prompts and inputs explicit data instead of code paths.&lt;/p&gt;

&lt;p&gt;If you are building something similar, the thing I would actually copy is the quote/settle split: it is fifteen lines of code that turn a whole class of support tickets into a number the user already saw.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Verifying generated GIFs before you ship them: loop count, transparency and size</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Sun, 22 Nov 2026 05:48:30 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/verifying-generated-gifs-before-you-ship-them-loop-count-transparency-and-size-406h</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/verifying-generated-gifs-before-you-ship-them-loop-count-transparency-and-size-406h</guid>
      <description>&lt;p&gt;Most "generated GIF" bugs are not generation bugs. They are shipping bugs: the file plays once instead of looping, the background is a flat black square instead of transparent, or the asset quietly blows past the upload limit of the platform you built it for.&lt;/p&gt;

&lt;p&gt;I build an AI emote generator (&lt;a href="https://emoteloop.com/" rel="noopener noreferrer"&gt;EmoteLoop&lt;/a&gt;) where the output has to survive a very literal contract: a single GIF file, transparent background, loops forever, under the size limit, uploadable as a Twitch animated emote. Every one of those properties is checkable in a few lines of Python, so nothing reaches the user until it passes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four checks that catch almost everything
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="no"&gt;PIL&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;

&lt;span class="no"&gt;MAX_BYTES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1_000_000&lt;/span&gt;  &lt;span class="c1"&gt;# platform upload limit&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;frames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;getattr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"n_frames"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;loop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"loop"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;          &lt;span class="c1"&gt;# Netscape loop extension&lt;/span&gt;
    &lt;span class="n"&gt;has_transparency&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"transparency"&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;
    &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"rb"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"frames"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"loop"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;loop&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"transparency_index"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;has_transparency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="s2"&gt;"bytes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the result rather than trusting it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;frames == 1&lt;/code&gt; means the model produced a still. Reject.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;loop&lt;/code&gt; missing means the file plays once and stops. &lt;code&gt;loop == 0&lt;/code&gt; means infinite, which is what you want for an emote.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;transparency in img.info&lt;/code&gt; only says a transparent palette index exists. It does not say the background actually uses it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last point is the one that bites. A GIF can carry a transparency index and still paint an opaque rectangle, because the frame's background pixels never reference that index.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check the pixels, not the metadata
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;background_is_transparent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;samples&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"RGBA"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;
    &lt;span class="n"&gt;pts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;# corners&lt;/span&gt;
        &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;w&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;        &lt;span class="c1"&gt;# edges&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;alphas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getpixel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;pts&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;alphas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sampling the border instead of a single corner matters: diffusion output often leaves one clean corner and a dirty edge that a chat client will happily render.&lt;/p&gt;

&lt;h2&gt;
  
  
  Size is a budget, not a check
&lt;/h2&gt;

&lt;p&gt;The cheapest fix for "too big" is usually re-encoding, and the cheapest re-encode that keeps quality is palette reduction plus fewer frames:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;shrink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;128&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;img&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;frames&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;n_frames&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;step&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;seek&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;img&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"RGBA"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;quantize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;save&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;save_all&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;append_images&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;frames&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;loop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;disposal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;optimize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;disposal=2&lt;/code&gt; (restore to background) is what keeps transparency between frames. The default can smear frame one's pixels into every later frame, which is the classic "ghost trail" artifact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fail closed
&lt;/h2&gt;

&lt;p&gt;The pipeline returns credits instead of returning a broken asset. Concretely, the generation is only "done" when all four checks pass: more than one frame, infinite loop, transparent border, and under the byte cap at the exact canvas size the target platform wants.&lt;/p&gt;

&lt;p&gt;If you are generating emotes for Twitch specifically, the order matters: generate at a large square canvas, verify, then downscale to 112 / 56 / 28 px with a resampler that preserves alpha, and re-check the byte cap on each size. The 28 px version is where transparency mistakes become obvious.&lt;/p&gt;

&lt;p&gt;I packaged this into &lt;a href="https://emoteloop.com/" rel="noopener noreferrer"&gt;EmoteLoop&lt;/a&gt;: a selfie or one sentence in, a transparent looping 512px GIF out, with the checks above gating the result. Not affiliated with or endorsed by Twitch.&lt;/p&gt;

</description>
      <category>tutorial</category>
    </item>
    <item>
      <title>Pulling investor follow signals into your own scripts (MCP + HTTP API)</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Sat, 21 Nov 2026 04:26:44 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/pulling-investor-follow-signals-into-your-own-scripts-mcp-http-api-3o07</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/pulling-investor-follow-signals-into-your-own-scripts-mcp-http-api-3o07</guid>
      <description>&lt;p&gt;I wanted the "who just followed which new AI startup" signal to land in my own scripts, not just in a browser tab. Notes from wiring that up, using Earlyfollow's MCP server and HTTP API as the example.&lt;/p&gt;

&lt;h2&gt;
  
  
  What counts as a new follow
&lt;/h2&gt;

&lt;p&gt;Each day the job re-reads the follow lists of the tracked accounts and keeps only the accounts that appear ahead of the ones already followed. Position, not timestamps, because X does not publish when a follow happened — the date you see is the day the follow was spotted. Follows that existed when tracking started are kept as a baseline and never presented as new. That kills most of the noise from unfollows and reshuffles.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect over MCP
&lt;/h2&gt;

&lt;p&gt;For Codex, two lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;codex mcp add earlyfollow --url https://earlyfollow.com/mcp
codex mcp login earlyfollow
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any other client that speaks HTTP transport can register the same URL; the auth step follows the client's own OAuth flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Call the HTTP API
&lt;/h2&gt;

&lt;p&gt;For a cron job, skip MCP and POST straight to the list endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://earlyfollow.com/api/v1/list-signals \
  -H &lt;span class="s1"&gt;'content-type: application/json'&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"authorization: Bearer $EARLYFOLLOW_API_KEY"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "request_id": "daily-2026-11-21",
    "window": 7,
    "sort": "concentration",
    "kind": "company",
    "query": "agent"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A project API key is required; without one the response is &lt;code&gt;authentication_required&lt;/code&gt;, and over MCP the &lt;code&gt;codex mcp login&lt;/code&gt; session covers it.&lt;/p&gt;

&lt;p&gt;Parameters are narrow on purpose: &lt;code&gt;window&lt;/code&gt; is 7 or 30, &lt;code&gt;sort&lt;/code&gt; is &lt;code&gt;concentration&lt;/code&gt; (how many tracked accounts follow it) or &lt;code&gt;latest&lt;/code&gt; (detection day), &lt;code&gt;kind&lt;/code&gt; is &lt;code&gt;company&lt;/code&gt; or &lt;code&gt;person&lt;/code&gt;. Personal accounts only show up on the paid side, so ask for &lt;code&gt;kind=company&lt;/code&gt; when you want something close to the public list.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use request_id as an idempotency key
&lt;/h2&gt;

&lt;p&gt;The quiet win is &lt;code&gt;request_id&lt;/code&gt;: it must match &lt;code&gt;^[-\w:.]{1,120}$&lt;/code&gt;, and results are retained for 30 days. If a response gets lost, replaying the same ID returns the same result instead of fetching twice. For a daily job, "run date + window" is a good ID shape — a retry then just re-runs the same call.&lt;/p&gt;

&lt;h2&gt;
  
  
  When you aggregate it
&lt;/h2&gt;

&lt;p&gt;Most new follows land on people, not companies. To present a company list you also need to resolve the profile to a company and keep the rest as people. And a follow is a record of attention, not a forecast. Public pages and the free weekly list run 14 days behind, so anything that needs the last few days has to come from the paid side.&lt;/p&gt;

&lt;p&gt;If you want to see the same data as a human-readable board, that lives at &lt;a href="https://earlyfollow.com/" rel="noopener noreferrer"&gt;https://earlyfollow.com/&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>automation</category>
      <category>mcp</category>
    </item>
    <item>
      <title>I Tested GLM-5.3-Flash and Qwen3.8-Flash on 24 Real Tasks</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Thu, 27 Aug 2026 14:09:47 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/i-tested-glm-53-flash-and-qwen38-flash-on-24-real-tasks-49pe</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/i-tested-glm-53-flash-and-qwen38-flash-on-24-real-tasks-49pe</guid>
      <description>&lt;p&gt;I test-ran both of this week's open-weight flash models against 24 small, real workloads from an actual product stack — structured extraction, SEO metadata, and code fixes — and graded everything programmatically. The short version: &lt;strong&gt;on quality the two models are effectively tied across all 24 tasks, cost splits by task type rather than by price list, and the biggest launch-day difference wasn't intelligence at all — it was a 429 storm that cleared within 24 hours.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both models dropped within a day of each other. GLM-5.3-Flash (320B total, 18B active) rode a wave of "frontier intelligence at flash cost" claims, including a now-confirmed anonymous stint as &lt;em&gt;ox-alpha&lt;/em&gt; on OpenRouter. Qwen3.8-Flash-Next (125B + 51B N-gram embedding, 6B active) is the architecture preview for Qwen4. On paper they're close: 63.4 vs 58.7 on DeepSWE 1.1. Benchmarks won't settle which one you should actually wire into a product this month. Small, boring, real tasks might.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Both via OpenRouter, &lt;code&gt;temperature: 0&lt;/code&gt;, one call per task, same prompts: &lt;code&gt;z-ai/glm-5.3-flash&lt;/code&gt; ($0.075/M in, $0.25/M out) and &lt;code&gt;qwen/qwen3.8-flash&lt;/code&gt; ($0.15/M in, $0.47/M out).&lt;/li&gt;
&lt;li&gt;3 suites, 24 tasks total, all graded by machine, not vibes:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Extraction (10):&lt;/strong&gt; messy real-world blobs — support tickets, log fragments, changelogs, pricing pages, review text — into strict JSON schemas.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SEO metadata (10):&lt;/strong&gt; title + meta description under hard constraints (title ≤ 60 chars, description 140–160 chars, keyword must appear in both).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code (4):&lt;/strong&gt; write or fix small utility functions (slugify with accent transliteration, a buggy debounce, duration parsing, CSV escaping). Pass/fail = does the hidden test suite run green.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Everything recorded: latency, tokens, cost per call, retry counts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One honesty note before the numbers: this is one day (plus a follow-up run ~20 hours later — see Finding 3), one shared API pool, N=24 — not a benchmark lab. Treat it as a smoke test from a builder's desk, which is exactly the decision most people are making this week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 1: Extraction is a tie — and the "failures" are judgment calls, not errors
&lt;/h2&gt;

&lt;p&gt;Both models returned &lt;strong&gt;schema-valid JSON on 10/10 tasks&lt;/strong&gt;. Zero parse failures either way.&lt;/p&gt;

&lt;p&gt;Under strict field-by-field grading against my gold answers, it looks lopsided — until you read the "failures":&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Task&lt;/th&gt;
&lt;th&gt;What actually happened&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Phone-mount listing&lt;/td&gt;
&lt;td&gt;Both extracted the product fine. GLM appended a &lt;code&gt;black&lt;/code&gt; tag; Qwen kept &lt;code&gt;(BLACK)&lt;/code&gt; in the name. Both defensible readings of the same sloppy source.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Support-ticket triage&lt;/td&gt;
&lt;td&gt;Qwen escalated severity to &lt;code&gt;critical&lt;/code&gt; where I expected &lt;code&gt;high&lt;/code&gt;. With "URGENT!!!" and lost revenue in the ticket, that's a judgment call, not an error.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Changelog parse&lt;/td&gt;
&lt;td&gt;My gold answer was the wrong one — both models correctly captured a BREAKING API removal I'd missed when writing the key. Both models beat my grader.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Regraded with a two-tier rubric (exact on objective fields; "defensible variant" for judgment fields like verdicts and free-text): GLM 4 exact + 4 defensible + 2 real misses; Qwen 3 exact + 6 defensible + 1 real miss. That's inside the noise floor.&lt;/p&gt;

&lt;p&gt;Takeaway for builders: &lt;strong&gt;on these two models, extraction is a solved problem at the schema level.&lt;/strong&gt; Your prompt design — how you pin enums, nulls, and array semantics — matters more than which of the two you pick.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 2: Constraint-following is a tie too — but the token meters tell a stranger story
&lt;/h2&gt;

&lt;p&gt;Both models hit &lt;strong&gt;10/10 on the SEO-metadata suite&lt;/strong&gt;: keyword present, title ≤ 60 chars, description inside the 140–160 window, every task.&lt;/p&gt;

&lt;p&gt;The interesting part is the cost structure beneath that tie. Measured average output tokens and per-task cost, by suite:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Suite&lt;/th&gt;
&lt;th&gt;GLM out-tokens/task&lt;/th&gt;
&lt;th&gt;GLM cost/task&lt;/th&gt;
&lt;th&gt;Qwen out-tokens/task&lt;/th&gt;
&lt;th&gt;Qwen cost/task&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Extraction&lt;/td&gt;
&lt;td&gt;780&lt;/td&gt;
&lt;td&gt;$0.00020&lt;/td&gt;
&lt;td&gt;458&lt;/td&gt;
&lt;td&gt;$0.00024&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SEO metadata&lt;/td&gt;
&lt;td&gt;3,119&lt;/td&gt;
&lt;td&gt;$0.00079&lt;/td&gt;
&lt;td&gt;1,522&lt;/td&gt;
&lt;td&gt;$0.00074&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Code&lt;/td&gt;
&lt;td&gt;1,502&lt;/td&gt;
&lt;td&gt;$0.00038&lt;/td&gt;
&lt;td&gt;3,364&lt;/td&gt;
&lt;td&gt;$0.00160&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Verbosity flips with task type. On prose-ish tasks GLM burns ~2× Qwen's tokens (reasoning overhead, presumably); on code generation Qwen burns ~2× GLM's — it pads code with more explanation. Neither model is "the cheap one"; &lt;strong&gt;which one is cheaper depends on which task mix your pipeline runs.&lt;/strong&gt; Pure token price is half the story, tokens-per-task is the other half, and only their product shows up on your invoice.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 3: Code — both 4/4, but one of them had to wait a day for the privilege
&lt;/h2&gt;

&lt;p&gt;On the original run day, GLM-5.3-Flash passed all four code tasks first-try: the transliteration-aware slugify, the debounce fix (early-fire bug), duration parsing with error handling, CSV escaping with quote-doubling.&lt;/p&gt;

&lt;p&gt;Qwen3.8-Flash couldn't attempt a single one — every call bounced off upstream rate limits for 50+ minutes. Twenty hours later, when the wall cleared, I reran the suite: &lt;strong&gt;all four passed&lt;/strong&gt;, three of them on the first try, two of them faster than GLM's original runs.&lt;/p&gt;

&lt;p&gt;So the code verdict is a quality tie with an asterisk: one model was available on launch day, and one wasn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding 4: The difference nobody benchmarks — availability, on day one
&lt;/h2&gt;

&lt;p&gt;The launch-day experience, recorded:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GLM-5.3-Flash: 24 calls, 24 first-try successes. Zero retries, zero waits.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen3.8-Flash: upstream 429s on 16 of the first 20 tasks&lt;/strong&gt;, 41 recorded retry cycles on those tasks alone, single-task waits up to 6 retries and several minutes, and the code suite fully unreachable for ~50 minutes of sustained attempts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the next day, the rate-limit wall had cleared — most rerun code tasks needed zero retries. Fair disclosure: that's OpenRouter's shared pool, not a dedicated Alibaba key, and launch-week demand is transient. But if your mental model of "cheap flash model" comes from a benchmark table, this is the column that's missing: &lt;strong&gt;on the day everyone is wiring a new model in, the model everyone wants may be the one you can't call.&lt;/strong&gt; If you ship on launch day, budget for backoff logic or bring your own provider key.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bill
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;GLM-5.3-Flash&lt;/th&gt;
&lt;th&gt;Qwen3.8-Flash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Tasks completed&lt;/td&gt;
&lt;td&gt;24/24&lt;/td&gt;
&lt;td&gt;24/24 (code suite ~20h later)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total cost&lt;/td&gt;
&lt;td&gt;$0.0115&lt;/td&gt;
&lt;td&gt;$0.0162&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost per task (blended)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.00048&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$0.00068&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Median successful-call latency&lt;/td&gt;
&lt;td&gt;~5.0s&lt;/td&gt;
&lt;td&gt;~15.6s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total retry cycles&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;43&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Flash-model API spend is a rounding error at any realistic volume — but notice the blended per-task gap (~30%) is entirely a task-mix artifact: on my metadata-heavy mix GLM wins, on a code-heavy mix the gap flips toward Qwen's favor on prose and against it on code (see Finding 2). The real cost is engineering time spent verifying output quality — which is exactly what suites like this exist to compress into an afternoon.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to pick which
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Your workload&lt;/th&gt;
&lt;th&gt;Pick&lt;/th&gt;
&lt;th&gt;Why&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Structured extraction / ETL glue&lt;/td&gt;
&lt;td&gt;Either&lt;/td&gt;
&lt;td&gt;Schema validity 10/10 both; disagreements are judgment calls&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hard format constraints&lt;/td&gt;
&lt;td&gt;Either&lt;/td&gt;
&lt;td&gt;10/10 both; per-task cost within ~7% on this suite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Small code generation &amp;amp; repair&lt;/td&gt;
&lt;td&gt;Either&lt;/td&gt;
&lt;td&gt;4/4 both — Qwen's code answers just cost ~4× more per task (~2× the tokens at double the price)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shipping on a model's launch day&lt;/td&gt;
&lt;td&gt;GLM-5.3-Flash&lt;/td&gt;
&lt;td&gt;Zero-retry day-one availability vs a 429 wall&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prose-heavy pipelines on a budget&lt;/td&gt;
&lt;td&gt;Qwen3.8-Flash&lt;/td&gt;
&lt;td&gt;Half the output tokens on text tasks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Latency-sensitive&lt;/td&gt;
&lt;td&gt;GLM-5.3-Flash&lt;/td&gt;
&lt;td&gt;~5s vs ~15.6s median successful calls&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One day plus one 20-hour follow-up, one shared pool, temperature 0, single attempt per prompt. N=24, not 2,400.&lt;/li&gt;
&lt;li&gt;My gold answers had at least one real bug (the changelog task). Two-tier regrading exists precisely because strict grading miscounted defensible variants as errors — your graders will have the same problem.&lt;/li&gt;
&lt;li&gt;Programmatic graders can't see creativity, tone, or long-horizon agent behavior. For agent workloads, the labs' DeepSWE/CoWorkBench numbers remain the better signal.&lt;/li&gt;
&lt;li&gt;Qwen's launch-day availability numbers are a shared-pool, launch-week phenomenon and demonstrably transient; treat them as "what day one feels like," not steady state.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The task set is 30 minutes of work to replicate against your own workloads — and your workload decides this better than any benchmark table. If you run it, I'd genuinely like to see your numbers.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>benchmark</category>
    </item>
    <item>
      <title>RenoBrief - AI home redesign with contractor-ready renovation briefs</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Mon, 25 May 2026 14:27:53 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/renobrief-ai-home-redesign-with-contractor-ready-renovation-briefs-3mi</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/renobrief-ai-home-redesign-with-contractor-ready-renovation-briefs-3mi</guid>
      <description>&lt;p&gt;RenoBrief AI: Turn Any Photo into a Renovation Plan in Seconds&lt;/p&gt;

&lt;p&gt;Upload a room or exterior photo, get a stunning redesign — plus a budget, material list, and contractor-ready brief. No design degree needed — just snap, style, and plan.&lt;/p&gt;

&lt;p&gt;One Tool, From Vision to Action&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI Interior &amp;amp; Exterior Remodel — Upload any room or house photo, choose a style and budget, get a before/after redesign instantly.&lt;/li&gt;
&lt;li&gt;Contractor-Ready Brief — Every generation includes design direction, budget range, materials &amp;amp; finishes, and contractor notes. Not just a pretty picture.&lt;/li&gt;
&lt;li&gt;Budget-Aware Design — Pick your range: Refresh under $500, Remodel under $2,000, or Premium $10,000+. AI designs within your budget, not against it.&lt;/li&gt;
&lt;li&gt;AI Floor Plan Generator — Enter room count, square footage, and layout preferences. Get a 2D floor plan with rationale and builder notes.&lt;/li&gt;
&lt;li&gt;Export &amp;amp; Share in One Click — Download a PDF brief to hand your contractor, partner, or agent. Copy as Markdown. No back-and-forth explaining what you want.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://renobrief.com/" rel="noopener noreferrer"&gt;Try Now！&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>CleanPaste.org - Remove Invisible Characters &amp; AI Watermarks (100% Free)</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Sun, 29 Mar 2026 14:03:47 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/cleanpasteorg-remove-invisible-characters-ai-watermarks-100-free-5k7</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/cleanpasteorg-remove-invisible-characters-ai-watermarks-100-free-5k7</guid>
      <description>&lt;p&gt;CleanPaste.org: The #1 Free AI Watermark Remover&lt;/p&gt;

&lt;p&gt;Instantly erase AI watermarks and hidden metadata with our powerful online tool, ensuring your text is completely undetectable and looks 100% human-written in seconds.&lt;/p&gt;

&lt;p&gt;One Click, Every AI Trace Erased&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Instantly Erase Statistical AI Watermarks&lt;/li&gt;
&lt;li&gt; Strip Hidden Metadata &amp;amp; Invisible Characters&lt;/li&gt;
&lt;li&gt; Humanize Text to Bypass AI Detectors&lt;/li&gt;
&lt;li&gt; Ensure Originality with a Plagiarism Check&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://cleanpaste.org" rel="noopener noreferrer"&gt;Try now!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>AI Fruit - Create Viral AI Fruit Videos in Seconds</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Sat, 21 Mar 2026 05:50:52 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/ai-fruit-create-viral-ai-fruit-videos-in-seconds-eci</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/ai-fruit-create-viral-ai-fruit-videos-in-seconds-eci</guid>
      <description>&lt;p&gt;AI Fruit: Create Viral AI Fruit Videos in Seconds&lt;/p&gt;

&lt;p&gt;The easiest way to make fruit-eating-fruit ASMR videos for TikTok, Instagram &amp;amp; YouTube. No editing skills needed — just pick a fruit, choose a vibe, and let AI do the rest.&lt;/p&gt;

&lt;p&gt;One Tool, Endless Viral Content&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;50+ Fruit Templates — Pre-built prompts for every trending fruit style. One click to generate.&lt;/li&gt;
&lt;li&gt;Multiple AI Models — Powered by Wan 2.5, Seedance, Hailuo, Kling &amp;amp; more. Pick quality or speed.&lt;/li&gt;
&lt;li&gt;TikTok-Ready Formats — 9:16 vertical, 16:9 landscape, 1:1 square. Watermark-free with commercial license.&lt;/li&gt;
&lt;li&gt;Auto ASMR Sound Effects — Crunchy, juicy, satisfying audio that hooks viewers and drives views.&lt;/li&gt;
&lt;li&gt;Videos Ready in Under 60 Seconds — Batch create content for your niche account at scale.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://aifruit.app" rel="noopener noreferrer"&gt;Try now!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6868iw8k67lcvyow40o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6868iw8k67lcvyow40o.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>City Map Poster Generator — Turn Any Location Into Printable Wall Art</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Tue, 03 Mar 2026 06:13:15 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/city-map-poster-generator-turn-any-location-into-printable-wall-art-20g8</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/city-map-poster-generator-turn-any-location-into-printable-wall-art-20g8</guid>
      <description>&lt;p&gt;The Easiest City Map Poster Generator for Stunning Wall Art&lt;/p&gt;

&lt;p&gt;Stop settling for generic prints or expensive custom designs. Map Poster Generator uses AI to transform any city, neighborhood, or street on Earth into beautiful, one-of-a-kind map posters. Whether it's the city where you fell in love, the hometown you grew up in, or a dream destination you've always wanted to visit, our city map poster generator turns your favorite places into high-resolution, print-ready wall art in seconds. Design faster, gift smarter, and decorate with meaning.&lt;/p&gt;

&lt;p&gt;One Tool, Endless Map Poster Styles&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AI-Powered City Map Art: Every city map poster is uniquely generated by AI — no two designs are ever the same&lt;/li&gt;
&lt;li&gt;12+ Art Styles: Watercolor, minimalist, vintage, modern, blueprint, neon, and more to match any room or mood&lt;/li&gt;
&lt;li&gt;Any Location Worldwide: From major capitals to small towns, generate a city map poster for any place on the planet&lt;/li&gt;
&lt;li&gt;Print-Ready &amp;amp; Free to Try: Download high-resolution map posters in PNG, JPG, or PDF — your first poster is free&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://mappostergenerator.com" rel="noopener noreferrer"&gt;Try now!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>nanobanana</category>
      <category>programming</category>
    </item>
    <item>
      <title>Get Magic Tools - Discover the Best Software to Supercharge Your Workflow</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Tue, 27 Jan 2026 17:49:36 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/get-magic-tools-discover-the-best-software-to-supercharge-your-workflow-4np3</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/get-magic-tools-discover-the-best-software-to-supercharge-your-workflow-4np3</guid>
      <description>&lt;p&gt;The Ultimate Directory for Modern Digital Creators&lt;/p&gt;

&lt;p&gt;Stop wasting time on manual tasks or searching for the right software. Get Magic Tools connects you with the web's most powerful utilities, SaaS, and productivity apps. Whether it's cutting-edge AI, essential developer tools, or creative assets, our curated directory helps you find the "magic" solutions that solve real problems instantly. Build faster, design better, and work smarter.&lt;/p&gt;

&lt;p&gt;One Platform, Endless Productivity&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hand-Picked Quality: Rigorously tested tools that actually provide value&lt;/li&gt;
&lt;li&gt;Beyond Just AI: A complete collection of SaaS, dev utilities, and creative apps&lt;/li&gt;
&lt;li&gt;Boost Efficiency: Discover software designed to automate and simplify your work&lt;/li&gt;
&lt;li&gt;For Makers &amp;amp; Pros: Essential resources for founders, developers, and designers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://getmagictools.com" rel="noopener noreferrer"&gt;Try now!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Foundation Men - Transform Your Look with AI Before Making Any Changes</title>
      <dc:creator>li wujie</dc:creator>
      <pubDate>Mon, 12 Jan 2026 15:31:25 +0000</pubDate>
      <link>https://dev.to/li_wujie_0995d9c1bca1f2e3/foundation-men-transform-your-look-with-ai-before-making-any-changes-7fa</link>
      <guid>https://dev.to/li_wujie_0995d9c1bca1f2e3/foundation-men-transform-your-look-with-ai-before-making-any-changes-7fa</guid>
      <description>&lt;p&gt;AI-Powered Grooming Tools for the Modern Man&lt;/p&gt;

&lt;p&gt;Stop guessing your skin tone or wondering if a new hairstyle suits you. FoundationMen uses advanced AI to analyze your skin, simulate invisible makeup looks, and preview hairstyles—all from a single selfie. Whether you want to cover imperfections naturally or find your next haircut, our tools give you confidence before you commit. Try it free today and see the difference.&lt;/p&gt;

&lt;p&gt;One Photo, Three Powerful Transformations&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Analyze Your Skin Tone &amp;amp; Undertone with 99% Accuracy&lt;/li&gt;
&lt;li&gt;Preview Invisible Makeup That No One Will Notice&lt;/li&gt;
&lt;li&gt;Try Different Hairstyles Before Visiting the Barber&lt;/li&gt;
&lt;li&gt;Make Confident Grooming Decisions Backed by AI&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://foundationmen.com" rel="noopener noreferrer"&gt;Try now!&lt;/a&gt;&lt;/p&gt;

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