<?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: Project Echoes</title>
    <description>The latest articles on DEV Community by Project Echoes (@echoesresonance).</description>
    <link>https://dev.to/echoesresonance</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%2F4243272%2Fe61dede2-3092-4907-a542-bed1fc6f4274.png</url>
      <title>DEV Community: Project Echoes</title>
      <link>https://dev.to/echoesresonance</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/echoesresonance"/>
    <language>en</language>
    <item>
      <title>750 SVG portraits, no image model: generating the Echoes collection with a parametric Python builder</title>
      <dc:creator>Project Echoes</dc:creator>
      <pubDate>Fri, 13 Nov 2026 17:06:16 +0000</pubDate>
      <link>https://dev.to/echoesresonance/750-svg-portraits-no-image-model-generating-the-echoes-collection-with-a-parametric-python-builder-14g8</link>
      <guid>https://dev.to/echoesresonance/750-svg-portraits-no-image-model-generating-the-echoes-collection-with-a-parametric-python-builder-14g8</guid>
      <description>&lt;p&gt;Echoes is a storytelling NFT project on Solana: 750 generative portraits across three factions — the Cartographer's Guild, the Lantern Choir and the Verdant Order — with the community voting weekly on where the story goes next. The narrative framework sets the scene: "Six centuries after the Silent Collapse erased most records, the survivors of the orbital platform &lt;em&gt;Kestrel's Veil&lt;/em&gt; live among ruins that remember only in fragments — \"Echoes\": images, songs, and personalities left in old machines."&lt;/p&gt;

&lt;p&gt;The art direction is approved. The production mint has not started. What follows is the part that is just engineering: how the collection is generated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why parametric SVG instead of an image model
&lt;/h2&gt;

&lt;p&gt;An image model was the obvious first instinct. We went another way for boring, specific reasons.&lt;/p&gt;

&lt;p&gt;The collection needs 750 pieces that are &lt;em&gt;related&lt;/em&gt; — one world, three visual identities — and individually distinguishable. A diffusion-style pipeline gets that through a large, hard-to-audit generation pass plus heavy curation, and the trait list ends up describing the output rather than producing it. If the metadata says "7 hair options, 6 armour options", you want that to be literally true.&lt;/p&gt;

&lt;p&gt;A parametric builder inverts the relationship. Traits are real functions; the manifest is generated from the same data the artwork is. Every portrait is a text file — diffable, hashable, reviewable line by line. There is no model to version and no sampling temperature to explain, because determinism is the default behaviour of the thing, not a feature bolted on.&lt;/p&gt;

&lt;p&gt;The trade is explicit: we gave up the visual range of an image model in exchange for a collection whose claims are mechanically checkable.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the builder works
&lt;/h2&gt;

&lt;p&gt;Every portrait uses the same fixed layer stack — fifteen groups, from background and faction sigil through attire, hair-back, head, face, hair-front and accessory — in a 1024×1024 viewBox. Only the trait functions plugged into each layer change.&lt;/p&gt;

&lt;p&gt;Each trait is a plain Python function returning SVG string fragments. A surveyor's cap draws a domed crown, an asymmetric visor, a seam and a brass compass pin, and scales horizontally to the head it is drawn on, so one implementation works across every head shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trait library and compatibility rules
&lt;/h2&gt;

&lt;p&gt;Traits are keyed by faction. Each of the three factions has 7 hair/headwear options, 6 armour options and 5 real accessories, plus an optional &lt;code&gt;none&lt;/code&gt;. Shared across all three: 5 head shapes, 6 skins, 6 eye styles, 7 brow styles, 8 mouths, 12 hair colours and 5 facial details.&lt;/p&gt;

&lt;p&gt;Fourteen rules (R1–R14) encode pairs that cannot coexist — a goggle strap and a cap band occupy the same forehead line; a bob's side panel covers the ear a pencil tucks behind; a wide-brim hat would hide a circlet. Rules apply while picking and are checked again afterwards by &lt;code&gt;validate_traits&lt;/code&gt;, which also rejects unknown or cross-faction values.&lt;/p&gt;

&lt;p&gt;Uniqueness is enforced too: every visible combination is unique within its faction, and any two portraits in a faction differ in at least 3 of 7 salient slots — head, eyes, brows, mouth, hair, armour, accessory.&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;_salient_diff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&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;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&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;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;SALIENT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Determinism, mechanically
&lt;/h2&gt;

&lt;p&gt;Randomness is hash-seeded: a SHA-256 of seed, faction, item index and attempt number becomes that candidate's RNG. No global random state, so the entire 750-piece set reproduces from one string — currently &lt;code&gt;echoes-gen0-svg-local-test-v1&lt;/code&gt;.&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;_rng&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;parts&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="n"&gt;hashlib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"|"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seed&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="kt"&gt;tuple&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parts&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="nf"&gt;encode&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="nf"&gt;hexdigest&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="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&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="mi"&gt;16&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;Selection is least-used-first: among the values allowed at that point, only those within the current slack of the least-used count stay eligible, so no base trait quietly becomes the rare one. Slots fill in a deliberate order — hair, armour, accessory, eyes, mouth, brows, head, detail, skin, hair colour — so constrained choices prune the search before free ones.&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;for&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="no"&gt;SLOT_ORDER&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;allowed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nf"&gt;_rule_ok&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;v&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="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&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;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;allowed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;pool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;allowed&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;counts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;lo&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;slack&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;rng&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randrange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pool&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;h2&gt;
  
  
  The one filter pass
&lt;/h2&gt;

&lt;p&gt;Flat vector work can read as sterile, so each faction carries procedural grain: a single &lt;code&gt;feTurbulence&lt;/code&gt; chain in fractal-noise mode, tinted through &lt;code&gt;feColorMatrix&lt;/code&gt; and applied as a low-opacity overlay. Parameters differ per faction — the Guild a tight high-frequency grain at &lt;code&gt;baseFrequency="0.85"&lt;/code&gt;, the Choir a soft low-frequency bloom at &lt;code&gt;0.012&lt;/code&gt;, the Verdant Order an anisotropic fibre at &lt;code&gt;0.04 0.5&lt;/code&gt; — each with a fixed noise seed, so texture is as reproducible as geometry. The overlay is clipped &lt;em&gt;inside&lt;/em&gt; the attire silhouette rather than sitting over it, so grain reads as material. This is the one place the pipeline leans on the renderer; turbulence rendering is the most plausible source of rasteriser-to-rasteriser differences, and that has not been tested across renderers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validation
&lt;/h2&gt;

&lt;p&gt;Two stdlib &lt;code&gt;unittest&lt;/code&gt; suites sit around the generator: 21 tests over the generator and trait library, and 33 over the metadata-preparation package built on top of it. What they assert matters more than the count:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;exactly 750 files, 250 per faction, every file's SHA-256 matching the collection manifest;&lt;/li&gt;
&lt;li&gt;every SVG well-formed, no duplicate ids, no unresolved internal references;&lt;/li&gt;
&lt;li&gt;no combination violating a compatibility rule;&lt;/li&gt;
&lt;li&gt;every visible combination within a faction unique;&lt;/li&gt;
&lt;li&gt;per-slot frequencies balanced — every option used, max−min never above 2;&lt;/li&gt;
&lt;li&gt;regenerating from scratch byte-identical to the committed set;&lt;/li&gt;
&lt;li&gt;refusal to write into a non-empty &lt;code&gt;portraits/&lt;/code&gt; directory;&lt;/li&gt;
&lt;li&gt;an impossible constraint raising rather than silently degrading.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A separate structural check covers the trait library: each new design is rendered in a fixed reference context, all colour literals are stripped, and the resulting geometry compared. Each design must have its own code object, its own colour-blind geometry, and pairwise element overlap below 0.5. The measured maximum is 0.182.&lt;/p&gt;

&lt;p&gt;To be explicit: that is structural evidence no trait is a recolour of another. It is not a perceptual or aesthetic judgement.&lt;/p&gt;

&lt;h2&gt;
  
  
  The export pipeline
&lt;/h2&gt;

&lt;p&gt;SVG is the master; PNG at 2048×2048 is the intended display format. Rather than pull in a headless browser, the pipeline uses ffmpeg's &lt;code&gt;librsvg&lt;/code&gt; decoder — ffmpeg 8.0.1 against librsvg 2.61.3 here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ffmpeg -hide_banner -loglevel error -y \
  -width 2048 -height 2048 -i portrait.svg \
  -frames:v 1 -c:v png portrait.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fixed &lt;code&gt;-width&lt;/code&gt;/&lt;code&gt;-height&lt;/code&gt; rather than auto-scaling keeps dimensions deterministic, and the script refuses to overwrite an existing PNG.&lt;/p&gt;

&lt;p&gt;Scope, stated plainly: the variation study rendered four portraits per faction, and the export path itself has been verified on sample renders — one clean render per faction, plus labelled reference renders for the pixel check below.&lt;/p&gt;

&lt;p&gt;What the samples did buy is a real check. A clean render and a labelled reference render of the same portrait were compared pixel by pixel: outside the label region they are identical (0 changed pixels), inside it roughly 61,300 pixels differ — exactly the label graphic. That proves the clean path preserves the artwork and drops only what it should.&lt;/p&gt;

&lt;p&gt;The tooling also labels itself: every portrait in the current set carries a visible &lt;strong&gt;NOT PRODUCTION&lt;/strong&gt; marker, and the tests assert it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;A production pipeline is being prepared — clean-art output mode, draft metadata, and the remaining polish ahead of launch. When the set is rendered and actually looked at, that will be the interesting follow-up post.&lt;/p&gt;

</description>
      <category>python</category>
      <category>productivity</category>
      <category>startup</category>
      <category>web3</category>
    </item>
  </channel>
</rss>
