<?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: duanrh</title>
    <description>The latest articles on DEV Community by duanrh (@duanrh).</description>
    <link>https://dev.to/duanrh</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%2F4254675%2F9dc6e45f-be3f-425e-acf5-4dc5d8f33b48.png</url>
      <title>DEV Community: duanrh</title>
      <link>https://dev.to/duanrh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/duanrh"/>
    <language>en</language>
    <item>
      <title>Check a Roblox avatar background in the browser before you spend 200 Robux</title>
      <dc:creator>duanrh</dc:creator>
      <pubDate>Fri, 20 Nov 2026 01:44:18 +0000</pubDate>
      <link>https://dev.to/duanrh/check-a-roblox-avatar-background-in-the-browser-before-you-spend-200-robux-50k</link>
      <guid>https://dev.to/duanrh/check-a-roblox-avatar-background-in-the-browser-before-you-spend-200-robux-50k</guid>
      <description>&lt;p&gt;Uploading a custom Roblox avatar background costs 200 Robux, and you can only upload one per day. The file has to be exactly 2560 × 1440 (16:9); a JPG, PNG, TGA or BMP; free of any alpha channel, even when every pixel looks solid; and sRGB. Only ID-verified creators with Roblox Plus can upload (group uploads are allowed). Fail a file check and the fee is still spent.&lt;/p&gt;

&lt;p&gt;I built a free checker so those problems can be caught first. It lives on &lt;a href="https://calcdenhq.com/roblox-avatar-background-template/" rel="noopener noreferrer"&gt;Calc Den's avatar background page&lt;/a&gt;. The image never leaves your device: the page reads the file in the browser, draws a preview with the template zones, and can export a fixed JPG.&lt;/p&gt;

&lt;h2&gt;
  
  
  Header checks, not an upload
&lt;/h2&gt;

&lt;p&gt;On drop or file pick, the script reads &lt;code&gt;file.arrayBuffer()&lt;/code&gt; into a &lt;code&gt;Uint8Array&lt;/code&gt; and inspects the header. Nothing is uploaded. The result is four pass/fail rows: format, size, alpha, and colour.&lt;/p&gt;

&lt;p&gt;PNG width and height come from IHDR. Alpha is flagged if the colour type is 4 or 6, or if a &lt;code&gt;tRNS&lt;/code&gt; chunk is present — the usual surprise, because many art tools write a transparency chunk even when the picture is fully opaque, and Roblox rejects the file. If an &lt;code&gt;iCCP&lt;/code&gt; or &lt;code&gt;cICP&lt;/code&gt; colour field looks like Display P3 or another wide-gamut profile, the colour row asks for an sRGB export.&lt;/p&gt;

&lt;p&gt;JPEG markers are walked to the frame header for size; JPEGs are treated as having no alpha, and an ICC profile in APP2 is scanned the same way. A BMP counts as having alpha if it is 32-bit or has a non-zero alpha mask. TGA has no reliable magic number, so the checker validates the header fields and treats 32-bit images, or a non-zero attribute-bit count, as alpha.&lt;/p&gt;

&lt;p&gt;If no wide-gamut profile name is found, the colour row is reported as sRGB (a header check, not full colour management). TGA files can still be checked from the header, but the preview and one-click fix skip them: those paths use &lt;code&gt;createImageBitmap&lt;/code&gt;, which the page only runs for PNG, JPG and BMP.&lt;/p&gt;

&lt;h2&gt;
  
  
  A 16:9 canvas with safe-area overlays
&lt;/h2&gt;

&lt;p&gt;The preview canvas is 1280 × 720, half of 2560 × 1440. The source image is cover-fitted into that frame, the same way the fixed export is cropped. Overlays are drawn from zones measured on Roblox's own template image.&lt;/p&gt;

&lt;p&gt;A green ellipse marks the &lt;strong&gt;safe area&lt;/strong&gt; (centred, slightly above the midline). In the avatar editor the image is wrapped onto a curved studio-sweep backdrop; this oval stays flat and visible from every camera angle, so important art belongs inside it. Outside it, a red tint marks the &lt;strong&gt;distortion area&lt;/strong&gt;, where the curve stretches the image — the page suggests keeping that band to sky, ground texture and gradients, and avoiding tall objects that cross the floor line. A fade band covers the outer 8% of the frame. There is also a stand-in for where the avatar stands, plus an optional floor / horizon line.&lt;/p&gt;

&lt;p&gt;Optional crop frames show the web profile, tablet, phone, and the square thumbnail — each screen shows a different slice of the same image. Roblox has not published exact crop numbers; the page credits two creators' independent measurements on the launch thread (Nogora22 and XxMakio).&lt;/p&gt;

&lt;p&gt;Each layer can be toggled. The same geometry can be downloaded as a 2560 × 1440 guide template to draw over in an art tool. That file is a guide layer, not an upload.&lt;/p&gt;

&lt;p&gt;If the image is the wrong size or has an alpha channel, a button builds a new 2560 × 1440 canvas, cover-crops the picture, flattens it onto white, and saves a JPEG at quality 0.92. JPEG cannot carry an alpha channel, which is the point. It is not a colour-profile conversion; it fixes the size and alpha problems that most often fail the upload check.&lt;/p&gt;

&lt;h2&gt;
  
  
  A related numbers problem: Steal an Egg mutations
&lt;/h2&gt;

&lt;p&gt;Calc Den is otherwise a small set of unofficial, browser-only &lt;a href="https://calcdenhq.com/" rel="noopener noreferrer"&gt;Roblox game calculators&lt;/a&gt;. The &lt;a href="https://calcdenhq.com/steal-an-egg/mutations/" rel="noopener noreferrer"&gt;Steal an Egg mutations page&lt;/a&gt; uses the same approach: show the formula, then let you try it.&lt;/p&gt;

&lt;p&gt;Colour variants and event traits multiply a pet's income, but they do not multiply each other. Only the bonus above 1× is added: &lt;code&gt;total mutation multiplier = 1 + sum(each multiplier − 1)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Hatch colours (Silver ×1.2, Golden ×2.5, Rainbow ×3.5) are mutually exclusive; event and shrine traits such as Nitro, Spectral, Enchanted and Parasite can stack on top. A worked example from the page: a $5B/s pet with four ×2.75 traits (Nitro, Scrambled, Enchanted and Spectral) is &lt;code&gt;1 + 1.75 × 4 = ×8&lt;/code&gt;, or $40B/s, not ×2.75⁴. Rainbow (×3.5) plus Enchanted and Spectral is ×7.&lt;/p&gt;

&lt;p&gt;Size is applied on top of that. Income is &lt;code&gt;base income × size multiplier × mutation multiplier&lt;/code&gt;. If &lt;code&gt;ratio&lt;/code&gt; is the pet's weight divided by its hidden base weight, the size term follows the wiki curve: &lt;code&gt;ratio^(37/60)&lt;/code&gt; up to 125× base weight, then &lt;code&gt;ratio^(2/5) × 125^(13/60)&lt;/code&gt; beyond that, continuous at the join. A pet at 10× base weight is already about ×4.1 — more than any single mutation. At 100× it is about ×17.1.&lt;/p&gt;

&lt;p&gt;Base incomes and weights come from the Steal an Egg Wiki (CC BY-SA 3.0). Calc Den is an unofficial fan site, not affiliated with Roblox or the game's developers. Both tools run locally in the browser.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>roblox</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
