<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Party Penguins on Medium]]></title>
        <description><![CDATA[Stories by Party Penguins on Medium]]></description>
        <link>https://medium.com/@partypenguins?source=rss-c0ae154e04c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Cd01FiShhrOfFuvX9fpLOg.png</url>
            <title>Stories by Party Penguins on Medium</title>
            <link>https://medium.com/@partypenguins?source=rss-c0ae154e04c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 17:38:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@partypenguins/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Art Story: Salvatore Dali]]></title>
            <link>https://partypenguins.medium.com/art-story-salvatore-dali-651e714c5a4c?source=rss-c0ae154e04c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/651e714c5a4c</guid>
            <dc:creator><![CDATA[Party Penguins]]></dc:creator>
            <pubDate>Fri, 03 Sep 2021 12:48:51 GMT</pubDate>
            <atom:updated>2021-09-03T12:48:51.496Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Salvatore Dali’s distinctive moustache is a face trait, while his melting clocks are a head trait in the upcoming Party Polar Bears NFT collection.</em></strong></p><p>Painted in 1931, <a href="https://en.wikipedia.org/wiki/Salvador_Dal%C3%AD">Salvador Dali’s</a> ‘<a href="https://en.wikipedia.org/wiki/The_Persistence_of_Memory">The Persistence of Memory</a>’ is one of the most famous works of art in the entire world, along with Da Vinci’s Mona Lisa and Picasso’s Guernica.</p><p>The Persistence of Memory is quite small, not much bigger than an ordinary piece of paper. Against a smooth and seemingly infinite horizon, are four liquid clocks.</p><p>At the center, one of the clocks curls over what appears to be a boneless, fish-like face. Another clock oozes off the side of a table-like surface. It is suggested that these three clocks may symbolize the past, present and the future — which are all subjective and open to interpretation. The fourth clock rests upside down with black ants gathered on top of it. Dali frequently used ants in his works to symbolize decay.</p><p>There have been many an interpretation of Dali’s melting clocks and what they mean, but when asked Dali compared the objects in the painting to melting Camembert cheese, and that the entire scene is fixed in an impossible state of timeless transformation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F-kkKopARBFrFO68CmLFRg.png" /></figure><p><strong>The Party Polar Bear art drop is on 6th September 2021. </strong>Only 6,060 Party Polar Bears available to be minted, with up to 3,030 to be claimed for free by Party Penguin holders. Join our <a href="https://discord.gg/PartyPenguins">Discord</a> or follow us on <a href="https://twitter.com/PartyPenguinNFT">Twitter</a> for more details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2xu4MsmiI6osys3Z_qbOQ.png" /></figure><p><strong>Join the Penguin Party!<br></strong>Website: <a href="https://partypenguins.club/">https://partypenguins.club/</a><br>Twitter: <a href="https://twitter.com/PartyPenguinNFT">https://twitter.com/PartyPenguinNFT</a><br>Discord: <a href="https://partypenguins.medium.com/discord.gg/PartyPenguins">https:</a>//<a href="https://t.co/BizP7ICwtL?amp=1">discord.gg/PartyPenguins</a><br>OpenSea: <a href="https://opensea.io/collection/party-penguins">https://opensea.io/collection/party-penguins</a></p><p><strong>Follow the team!</strong><br>Dev: <a href="https://twitter.com/pengwin_potter">https://twitter.com/pengwin_potter</a><br>Designer: <a href="https://twitter.com/rozi_525">https://twitter.com/rozi_525</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=651e714c5a4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pink Alien Penguin Giveaway for Party Penguin Holders]]></title>
            <link>https://partypenguins.medium.com/pink-alien-penguin-giveaway-for-party-penguin-holders-465a9dfd31ec?source=rss-c0ae154e04c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/465a9dfd31ec</guid>
            <dc:creator><![CDATA[Party Penguins]]></dc:creator>
            <pubDate>Thu, 02 Sep 2021 18:27:35 GMT</pubDate>
            <atom:updated>2021-09-07T22:33:12.103Z</atom:updated>
            <content:encoded><![CDATA[<p>With the <a href="https://twitter.com/PartyPenguinNFT/status/1432011917241901056">Party Polar Bear drop</a> right around the corner (Monday 9/6), we’re ramping up the giveaways and events for the Party Penguin community. Now holders will have a chance to win the <strong>1/1 Pink Alien Party Penguin</strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A95sQxgbLJ1n2Afm7hZFiA.png" /></figure><h3>Competition Details</h3><p><strong>Start date:</strong> Thursday, September 2nd</p><p><strong>End date:</strong> Thursday September 9th at 11am PT</p><h3>How To Participate</h3><p>We want to keep things as simple as possible for all of our Party Penguin holders. Here are the rules:</p><ol><li>Change your Twitter profile picture to a Party Penguin you own</li><li>Reply to <a href="https://twitter.com/PartyPenguinNFT/status/1433497795118305281">this tweet</a> with the OpenSea link of that same Party Penguin</li><li>Like and Retweet the <a href="https://twitter.com/PartyPenguinNFT/status/1433497795118305281">competition tweet</a></li><li>Be sure to keep the same profile picture on Twitter through the end of the competition on Thursday September 9th</li></ol><h3>Prizes</h3><p>It wouldn’t be a party if we only had a single prize, so let’s make this even more fun!</p><p><strong>1st place:</strong> <a href="https://opensea.io/assets/0x31f3bba9b71cb1d5e96cd62f0ba3958c034b55e9/5">Pink Alien Party Penguin</a></p><p><strong>2nd place:</strong> 0.5 ETH</p><p><strong>3rd, 4th, and 5th place:</strong> a Party Polar Bear each</p><p><strong>Daily Prizes:</strong> Multiple 0.1 ETH giveaways every day during the competition for everyone who participates</p><h3>How will the winners be selected?</h3><p>We borrowed a page out of the Cool Cats playbook and will be choosing the winners on Thursday September 9th via <a href="https://wheelofnames.com/">Wheel of Names</a>.</p><p>A few additional things to note:</p><ol><li>The competition will be closed to new entries on Thursday September 9th at 11am PT and winners will be selected later that same day</li><li>There will be <strong>daily 0.1 ETH prizes</strong> (in addition to the competition prizes) for those who join the competition right away</li><li>We will verify that the winners who are selected meet all of the criteria (have a profile picture of a Party Penguin they own). If a winner does not meet this criteria, we will redraw for the same prize</li></ol><p>Good luck Party Penguins!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=465a9dfd31ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Art Story: The Japanese Pompadour]]></title>
            <link>https://partypenguins.medium.com/art-story-the-japanese-pompadour-847baf419393?source=rss-c0ae154e04c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/847baf419393</guid>
            <dc:creator><![CDATA[Party Penguins]]></dc:creator>
            <pubDate>Tue, 31 Aug 2021 13:22:42 GMT</pubDate>
            <atom:updated>2021-08-31T13:28:19.414Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>The Japanese Pompadour is a head trait in the upcoming Party Polar Bears NFT collection</em></strong></p><p>First introduced by Madame de Pompadour, mistress of King Louis XV of France, the <a href="https://en.wikipedia.org/wiki/Pompadour_(hairstyle)">Pompadour hairstyle</a> was quickly adopted by other members of his court.</p><p>In more recent times, it was all the rage in post war Japan, with gang members of <a href="https://www.britannica.com/topic/yakuza">yakuza</a> and the <a href="https://en.wikipedia.org/wiki/B%C5%8Ds%C5%8Dzoku">bōsōzoku</a>, sporting it as a sign of rebellion against the established order. It has since made its way into Japanese pop culture, with anime characters such as <a href="https://yuyuhakusho.fandom.com/wiki/Kazuma_Kuwabara">Kazuma Kuwabara</a>, <a href="https://myanimelist.net/character/91119/Dandy">Dandy</a>, <a href="https://jojo.fandom.com/wiki/Josuke_Higashikata">Josuke Higashikata</a>, <a href="https://ippo.fandom.com/wiki/Mamoru_Takamura">Mamoru Takamura</a> and <a href="https://redline.fandom.com/wiki/JP">Sweet JP</a> rocking the Pompadour.</p><p>A variation of the Pompadour has since been called the Elvis Cut after Elvis Presley popularized it in the western world. The Pompadour has also been in vogue with James Dean and Marlon Brando.</p><p>Our Party Polar Beart Pompadour head trait has been inspired by Kuwabara of the YuYu Hakusho manga fame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGf5bO3i8T0ow74ueYrQkw.jpeg" /><figcaption>Image Credit: <a href="https://aminoapps.com/c/anime/page/blog/anime-review-yu-yu-hakusho/ggt6_uPjZP36gbxMEr0ZK82vL56N1X">https://aminoapps.com/c/anime/page/blog/anime-review-yu-yu-hakusho/ggt6_uPjZP36gbxMEr0ZK82vL56N1X</a></figcaption></figure><p><strong>The Party Polar Bear art drop is on 6th September 2021. </strong>Only 6,060 Party Polar Bears available to be minted, with up to 3,030 to be claimed for free by Party Penguin holders. Join our <a href="https://discord.gg/PartyPenguins">Discord</a> or follow us on <a href="https://twitter.com/PartyPenguinNFT">Twitter</a> for more details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j2xu4MsmiI6osys3Z_qbOQ.png" /></figure><p><strong>Join the Penguin Party!<br></strong>Website: <a href="https://partypenguins.club/">https://partypenguins.club/</a><br>Twitter: <a href="https://twitter.com/PartyPenguinNFT">https://twitter.com/PartyPenguinNFT</a><br>Discord: <a href="https://partypenguins.medium.com/discord.gg/PartyPenguins">https:</a>//<a href="https://t.co/BizP7ICwtL?amp=1">discord.gg/PartyPenguins</a><br>OpenSea: <a href="https://opensea.io/collection/party-penguins">https://opensea.io/collection/party-penguins</a></p><p><strong>Follow the team!</strong><br>Dev: <a href="https://twitter.com/pengwin_potter">https://twitter.com/pengwin_potter</a><br>Designer: <a href="https://twitter.com/rozi_525">https://twitter.com/rozi_525</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=847baf419393" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Party Penguins — The Airdrop]]></title>
            <link>https://partypenguins.medium.com/party-penguins-the-airdrop-e81a86aa0fe?source=rss-c0ae154e04c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e81a86aa0fe</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[airdrop]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[gas]]></category>
            <dc:creator><![CDATA[Party Penguins]]></dc:creator>
            <pubDate>Sat, 14 Aug 2021 13:37:17 GMT</pubDate>
            <atom:updated>2021-08-14T13:50:09.969Z</atom:updated>
            <content:encoded><![CDATA[<h3>Party Penguins — The Airdrop</h3><h4>One of the biggest yet ?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PP1-pRTl8iFzvJr7cUdnIQ.png" /><figcaption>Party Penguins</figcaption></figure><p>We did something we’re scared will give our mums a heart-attack if we ever told them how much we spent in transaction fees 🙂</p><p>Last week, we airdropped almost 3000 penguins to the Party Penguins community at a cost of <strong>10.7 ETH ($30,000+)</strong> in gas fees alone. The gas was pretty crazy at the time because of the London hard-fork, but we felt it needed to be done because it was in the best interest of the community. You can read more about that <a href="https://docs.google.com/document/d/1Nl3a6IAOTQsuRetyIzGeKpxOTZa5pNxf3tp_ENF-RVA/edit#">announcement here</a>.</p><p>These Party Penguins were <strong>worth 43 ETH</strong> at the time of airdrop (at an effective 0.015 ETH price with the BOGO offer we ran); and these free Party Penguins are <strong>worth AT LEAST 1350 ETH (or ~$4.5m)</strong> at floor price at the time of writing this blog post. Some Party Penguins have rarer traits and are worth a lot more, but let’s just account for the floor price for the sake of simplicity, shall we?</p><p>We thought of penning down some of the technical details on how we managed to do this, because in all the time we’ve spent being part of so many brilliant NFT communities so far, we haven’t seen gas that’s been paid for airdrops at this scale before. Here goes:</p><figure><a href="https://etherscan.io/address/0x006af13373d86f0025fa081283335b81cc394f9f#analytics"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57t6Cr2a9Qmrhvwdn3LcWA.png" /></a><figcaption>airdrop costs</figcaption></figure><p>So, at the time of snapshot, 3031 were penguins minted, out of which 157 were in the team wallets(due to an early floor buyback by us). That meant, airdropping <strong>2874</strong> penguins to <strong>655</strong> different holders. <a href="https://docs.google.com/spreadsheets/d/1GshkJKi6qVdp5UV9VGOPt2KxtvXxlI2IvEB9cKSCxww/edit#gid=0">Here’s the sheet</a> with all the details</p><p>We had estimated spending around 12 ETH for all the airdrops, assuming the gas price of 30~35 Gwei. The initial 5–6 airdrops were done directly through <a href="https://remix.ethereum.org/">Remix IDE</a>, manually, at times when the average gas was around 22–24 Gwei.</p><p>But, manual execution was not feasible to complete the rest of the airdrops. So, I wrote a script which automatically airdrops when the gas prices are low.</p><p>First, a bit about our <a href="https://etherscan.io/address/0x31F3bba9b71cB1D5e96cD62F0bA3958C034b55E9#code">smart contract</a>. There were 2 things I chose to do in our mint function, which turned out to be good decisions w.r.t airdrops.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528239%252C40%252C44%252C1%2529%26t%3Done-light%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D22px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D147%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dfunction%252520mint%2528address%252520_to%25252C%252520uint256%252520num%2529%252520public%252520payable%252520%25257B%25250A%252520%252520%252520%252520uint256%252520supply%252520%25253D%252520totalSupply%2528%2529%25253B%25250A%25250A%252520%252520%252520%252520if%2528msg.sender%252520%2521%25253D%252520owner%2528%2529%2529%252520%25257B%25250A%252520%252520%252520%252520%252520%252520require%2528%2521_paused%25252C%252520%252522Sale%252520Paused%252522%2529%25253B%25250A%252520%252520%252520%252520%252520%252520require%2528%252520num%252520%25253C%252520%2528_maxMint%25252B1%2529%25252C%252522You%252520can%252520adopt%252520a%252520maximum%252520of%252520_maxMint%252520Penguins%252522%252520%2529%25253B%25250A%252520%252520%252520%252520%252520%252520require%2528%252520msg.value%252520%25253E%25253D%252520_price%252520%252A%252520num%25252C%252522Ether%252520sent%252520is%252520not%252520correct%252522%252520%2529%25253B%25250A%252520%252520%252520%252520%25257D%25250A%25250A%252520%252520%252520%252520require%2528%252520supply%252520%25252B%252520num%252520%25253C%252520MAX_ENTRIES%25252C%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252522Exceeds%252520maximum%252520supply%252522%252520%2529%25253B%25250A%25250A%252520%252520%252520%252520for%2528uint256%252520i%25253B%252520i%252520%25253C%252520num%25253B%252520i%25252B%25252B%2529%25257B%25250A%252520%252520%252520%252520%252520%252520_safeMint%2528%252520_to%25252C%252520supply%252520%25252B%252520i%252520%2529%25253B%25250A%252520%252520%252520%252520%25257D%25250A%25257D&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528239%25252C40%25252C44%25252C1%252529%26t%3Done-light%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D22px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D147%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dfunction%25252520mint%252528address%25252520_to%2525252C%25252520uint256%25252520num%252529%25252520public%25252520payable%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520uint256%25252520supply%25252520%2525253D%25252520totalSupply%252528%252529%2525253B%2525250A%2525250A%25252520%25252520%25252520%25252520if%252528msg.sender%25252520%252521%2525253D%25252520owner%252528%252529%252529%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520require%252528%252521_paused%2525252C%25252520%25252522Sale%25252520Paused%25252522%252529%2525253B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520require%252528%25252520num%25252520%2525253C%25252520%252528_maxMint%2525252B1%252529%2525252C%25252522You%25252520can%25252520adopt%25252520a%25252520maximum%25252520of%25252520_maxMint%25252520Penguins%25252522%25252520%252529%2525253B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520require%252528%25252520msg.value%25252520%2525253E%2525253D%25252520_price%25252520%25252A%25252520num%2525252C%25252522Ether%25252520sent%25252520is%25252520not%25252520correct%25252522%25252520%252529%2525253B%2525250A%25252520%25252520%25252520%25252520%2525257D%2525250A%2525250A%25252520%25252520%25252520%25252520require%252528%25252520supply%25252520%2525252B%25252520num%25252520%2525253C%25252520MAX_ENTRIES%2525252C%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252522Exceeds%25252520maximum%25252520supply%25252522%25252520%252529%2525253B%2525250A%2525250A%25252520%25252520%25252520%25252520for%252528uint256%25252520i%2525253B%25252520i%25252520%2525253C%25252520num%2525253B%25252520i%2525252B%2525252B%252529%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520_safeMint%252528%25252520_to%2525252C%25252520supply%25252520%2525252B%25252520i%25252520%252529%2525253B%2525250A%25252520%25252520%25252520%25252520%2525257D%2525250A%2525257D&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2338452db55c96a8cc58ae4faa748bda/href">https://medium.com/media/2338452db55c96a8cc58ae4faa748bda/href</a></iframe><p><em>First</em>, the mint function accepts a <strong><em>_to</em></strong> address, so we could essentially mint the penguins directly to a wallet, instead of minting and transferring it(which would use slightly more gas).</p><p><em>Second</em>, owner of the contract can mint penguins for a price of 0 ETH. So, the only amount we had to keep in our owner wallet was the gas that would be used in minting. Even though we minted and airdropped <strong>43 ETH</strong>(at time of airdrop)<strong> </strong>worth of penguins, we didn’t have to keep that amount in our wallet.</p><h4>Setup code</h4><p>We start by some setup code to be used by all the scripts ahead</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528239%252C40%252C44%252C1%2529%26t%3Done-light%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D66px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D22px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D147%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dconst%252520Web3%252520%25253D%252520require%2528%2527web3%2527%2529%25250Aconst%252520fs%252520%25253D%252520require%2528%2527fs%2527%2529%25250Aconst%252520short_abi%252520%25253D%252520%25255B%25250A%252520%252520%25257B%25250A%252520%252520%252520%252520inputs%25253A%252520%25255B%25250A%252520%252520%252520%252520%252520%252520%25257B%25250A%252520%252520%252520%252520%252520%252520%252520%252520internalType%25253A%252520%2527address%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520name%25253A%252520%2527_to%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520type%25253A%252520%2527address%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%25257D%25252C%25250A%252520%252520%252520%252520%252520%252520%25257B%25250A%252520%252520%252520%252520%252520%252520%252520%252520internalType%25253A%252520%2527uint256%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520name%25253A%252520%2527_count%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520type%25253A%252520%2527uint256%2527%25252C%25250A%252520%252520%252520%252520%252520%252520%25257D%25252C%25250A%252520%252520%252520%252520%25255D%25252C%25250A%252520%252520%252520%252520name%25253A%252520%2527mint%2527%25252C%25250A%252520%252520%252520%252520outputs%25253A%252520%25255B%25255D%25252C%25250A%252520%252520%252520%252520stateMutability%25253A%252520%2527payable%2527%25252C%25250A%252520%252520%252520%252520type%25253A%252520%2527function%2527%25252C%25250A%252520%252520%25257D%25252C%25250A%25255D%25250A%25250Aconst%252520infura_project_id%252520%25253D%252520%2527%2527%25250Aconst%252520contract_address%252520%25253D%252520%25270x31F3bba9b71cB1D5e96cD62F0bA3958C034b55E9%2527%25250Aconst%252520owner_address%252520%25253D%252520%25270x006AF13373D86F0025Fa081283335b81cC394f9f%2527%25250Aconst%252520private_key_path%252520%25253D%252520%2527%2527%25250A%25250Alet%252520web3%252520%25253D%252520new%252520Web3%2528%25250A%252520%252520new%252520Web3.providers.HttpProvider%2528%25250A%252520%252520%252520%252520%252560https%25253A%25252F%25252Fmainnet.infura.io%25252Fv3%25252F%252524%25257Binfura_project_id%25257D%252560%25250A%252520%252520%2529%25250A%2529%25250Aconst%252520private_key%252520%25253D%252520fs.readFileSync%2528private_key_path%25252C%252520%2527utf8%2527%2529%25250Aconst%252520contract_instance%252520%25253D%252520new%252520web3.eth.Contract%2528short_abi%25252C%252520contract_address%2529%25250Aconst%252520readline%252520%25253D%252520require%2528%2527readline%2527%2529%25250A%25250Aconst%252520sleep%252520%25253D%252520%2528ms%2529%252520%25253D%25253E%252520%25257B%25250A%252520%252520return%252520new%252520Promise%2528%2528resolve%2529%252520%25253D%25253E%252520%25257B%25250A%252520%252520%252520%252520setTimeout%2528resolve%25252C%252520ms%2529%25250A%252520%252520%25257D%2529%25250A%25257D%25250A&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528239%25252C40%25252C44%25252C1%252529%26t%3Done-light%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D66px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D56px%26ph%3D22px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D147%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dconst%25252520Web3%25252520%2525253D%25252520require%252528%252527web3%252527%252529%2525250Aconst%25252520fs%25252520%2525253D%25252520require%252528%252527fs%252527%252529%2525250Aconst%25252520short_abi%25252520%2525253D%25252520%2525255B%2525250A%25252520%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520inputs%2525253A%25252520%2525255B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520internalType%2525253A%25252520%252527address%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520name%2525253A%25252520%252527_to%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520type%2525253A%25252520%252527address%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%2525257D%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520internalType%2525253A%25252520%252527uint256%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520name%2525253A%25252520%252527_count%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520type%2525253A%25252520%252527uint256%252527%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%2525257D%2525252C%2525250A%25252520%25252520%25252520%25252520%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520name%2525253A%25252520%252527mint%252527%2525252C%2525250A%25252520%25252520%25252520%25252520outputs%2525253A%25252520%2525255B%2525255D%2525252C%2525250A%25252520%25252520%25252520%25252520stateMutability%2525253A%25252520%252527payable%252527%2525252C%2525250A%25252520%25252520%25252520%25252520type%2525253A%25252520%252527function%252527%2525252C%2525250A%25252520%25252520%2525257D%2525252C%2525250A%2525255D%2525250A%2525250Aconst%25252520infura_project_id%25252520%2525253D%25252520%252527%252527%2525250Aconst%25252520contract_address%25252520%2525253D%25252520%2525270x31F3bba9b71cB1D5e96cD62F0bA3958C034b55E9%252527%2525250Aconst%25252520owner_address%25252520%2525253D%25252520%2525270x006AF13373D86F0025Fa081283335b81cC394f9f%252527%2525250Aconst%25252520private_key_path%25252520%2525253D%25252520%252527%252527%2525250A%2525250Alet%25252520web3%25252520%2525253D%25252520new%25252520Web3%252528%2525250A%25252520%25252520new%25252520Web3.providers.HttpProvider%252528%2525250A%25252520%25252520%25252520%25252520%25252560https%2525253A%2525252F%2525252Fmainnet.infura.io%2525252Fv3%2525252F%25252524%2525257Binfura_project_id%2525257D%25252560%2525250A%25252520%25252520%252529%2525250A%252529%2525250Aconst%25252520private_key%25252520%2525253D%25252520fs.readFileSync%252528private_key_path%2525252C%25252520%252527utf8%252527%252529%2525250Aconst%25252520contract_instance%25252520%2525253D%25252520new%25252520web3.eth.Contract%252528short_abi%2525252C%25252520contract_address%252529%2525250Aconst%25252520readline%25252520%2525253D%25252520require%252528%252527readline%252527%252529%2525250A%2525250Aconst%25252520sleep%25252520%2525253D%25252520%252528ms%252529%25252520%2525253D%2525253E%25252520%2525257B%2525250A%25252520%25252520return%25252520new%25252520Promise%252528%252528resolve%252529%25252520%2525253D%2525253E%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520setTimeout%252528resolve%2525252C%25252520ms%252529%2525250A%25252520%25252520%2525257D%252529%2525250A%2525257D%2525250A&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/df9e006d8d1e5939e489548caf89bea0/href">https://medium.com/media/df9e006d8d1e5939e489548caf89bea0/href</a></iframe><p>We initialise the contract and owner addresses, our <em>infura</em> key and private key path. Be very careful while handling private keys to locally sign transactions, <em>do not code them directly in any scripts</em>. We used a shortened ABI of the contract, only using the mint function which would be used for the airdrop.</p><h4>Simple airdrop transaction in js</h4><p>Following is a simple airdrop script which does the same manual transaction done in remix, only programmatically and hands free.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528239%252C40%252C44%252C1%2529%26t%3Done-light%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D22px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D147%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dasync%252520function%252520airdrop%252520%2528to_address%25252C%252520count%25252C%252520gas_price%2529%252520%25257B%25250A%252520%252520%252520%252520let%252520estimate%252520%25253D%252520await%252520contract_instance.methods.mint%2528to_address%25252C%252520count%2529.estimateGas%2528%25257B%25250A%252520%252520%252520%252520%252520%252520%252520%252520value%25253A%2525200%25252C%25250A%252520%252520%252520%252520%252520%252520%252520%252520from%25253A%252520owner_address%25250A%252520%252520%252520%252520%25257D%2529%25253B%25250A%252520%252520%252520%252520console.log%2528%252560Total%252520Gas%252520would%252520be%252520%252524%25257Bestimate%25257D%252520units%252560%2529%25253B%25250A%25250A%252520%252520%252520%252520const%252520tx%252520%25253D%252520%25257B%25250A%252520%252520%252520%252520%252520%252520from%25253A%252520owner_address%25252C%25250A%252520%252520%252520%252520%252520%252520to%25253A%252520contract_address%25252C%25250A%252520%252520%252520%252520%252520%252520gas%25253A%252520parseInt%2528estimate%2529%25252C%25250A%252520%252520%252520%252520%252520%252520value%25253A%2525200%25252C%25250A%252520%252520%252520%252520%252520%252520gasPrice%25253A%252520gas_price%25252C%25250A%252520%252520%252520%252520%252520%252520data%25253A%252520contract_instance.methods.mint%2528to_address%25252C%252520count%2529.encodeABI%2528%2529%25250A%252520%252520%252520%252520%25257D%25253B%25250A%25250A%252520%252520%252520%252520const%252520signedTx%252520%25253D%252520await%252520web3.eth.accounts.signTransaction%2528tx%25252C%252520private_key%2529%25250A%25250A%252520%252520%252520%252520const%252520txn_receipt%252520%25253D%252520await%252520web3.eth.sendSignedTransaction%2528signedTx.raw%252520%25257C%25257C%252520signedTx.rawTransaction%2529.on%2528%252522transactionHash%252522%25252C%252520%2528function%2528txn_hash%2529%252520%25257B%25250A%252520%252520%252520%252520%252520console.log%2528%252560Transaction%252520hash%252520for%252520%252524%25257Bto_address%25257D%252520is%252520%252524%25257Btxn_hash%25257D%252560%2529%25250A%252520%252520%252520%252520%25257D%2529%2529.on%2528%252522error%252522%25252C%252520err%252520%25253D%25253E%252520%25257B%25250A%252520%252520%252520%252520%252520%252520console.log%2528%252522Airdrop%252520failed%252520with%252520error%25253A%252520%252522%25252C%252520JSON.stringify%2528err%2529%2529%25250A%252520%252520%252520%252520%25257D%2529%25253B%25250A%252520%252520%252520%252520return%252520txn_receipt%25250A%25257D&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528239%25252C40%25252C44%25252C1%252529%26t%3Done-light%26wt%3Dnone%26l%3Dauto%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D68px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D56px%26ph%3D22px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D13px%26lh%3D147%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dasync%25252520function%25252520airdrop%25252520%252528to_address%2525252C%25252520count%2525252C%25252520gas_price%252529%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520let%25252520estimate%25252520%2525253D%25252520await%25252520contract_instance.methods.mint%252528to_address%2525252C%25252520count%252529.estimateGas%252528%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520value%2525253A%252525200%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520from%2525253A%25252520owner_address%2525250A%25252520%25252520%25252520%25252520%2525257D%252529%2525253B%2525250A%25252520%25252520%25252520%25252520console.log%252528%25252560Total%25252520Gas%25252520would%25252520be%25252520%25252524%2525257Bestimate%2525257D%25252520units%25252560%252529%2525253B%2525250A%2525250A%25252520%25252520%25252520%25252520const%25252520tx%25252520%2525253D%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520from%2525253A%25252520owner_address%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520to%2525253A%25252520contract_address%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520gas%2525253A%25252520parseInt%252528estimate%252529%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520value%2525253A%252525200%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520gasPrice%2525253A%25252520gas_price%2525252C%2525250A%25252520%25252520%25252520%25252520%25252520%25252520data%2525253A%25252520contract_instance.methods.mint%252528to_address%2525252C%25252520count%252529.encodeABI%252528%252529%2525250A%25252520%25252520%25252520%25252520%2525257D%2525253B%2525250A%2525250A%25252520%25252520%25252520%25252520const%25252520signedTx%25252520%2525253D%25252520await%25252520web3.eth.accounts.signTransaction%252528tx%2525252C%25252520private_key%252529%2525250A%2525250A%25252520%25252520%25252520%25252520const%25252520txn_receipt%25252520%2525253D%25252520await%25252520web3.eth.sendSignedTransaction%252528signedTx.raw%25252520%2525257C%2525257C%25252520signedTx.rawTransaction%252529.on%252528%25252522transactionHash%25252522%2525252C%25252520%252528function%252528txn_hash%252529%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520console.log%252528%25252560Transaction%25252520hash%25252520for%25252520%25252524%2525257Bto_address%2525257D%25252520is%25252520%25252524%2525257Btxn_hash%2525257D%25252560%252529%2525250A%25252520%25252520%25252520%25252520%2525257D%252529%252529.on%252528%25252522error%25252522%2525252C%25252520err%25252520%2525253D%2525253E%25252520%2525257B%2525250A%25252520%25252520%25252520%25252520%25252520%25252520console.log%252528%25252522Airdrop%25252520failed%25252520with%25252520error%2525253A%25252520%25252522%2525252C%25252520JSON.stringify%252528err%252529%252529%2525250A%25252520%25252520%25252520%25252520%2525257D%252529%2525253B%2525250A%25252520%25252520%25252520%25252520return%25252520txn_receipt%2525250A%2525257D&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/e13c53111ab90cd3c932e0bf33bed679/href">https://medium.com/media/e13c53111ab90cd3c932e0bf33bed679/href</a></iframe><p>The function airdrops <strong><em>count</em></strong> penguins to <strong><em>to_address </em></strong>at a given<strong><em> gas_price</em></strong>. We used Infura to broadcast a locally signed transaction over the network.</p><p><strong>Automated low cost Airdrop</strong></p><p>Lastly, we need a controller function to perform the airdrops when gas is low. It would check the current gas prices and decide whether to do the airdrop or wait. If the gas price is within a given limit, it will try and execute the airdrop and record the result, else, it just sleeps for sometime and tries again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VuD1ATa_ixuNgQf50hGiVw.png" /><figcaption>airdrop_all.js</figcaption></figure><p>The main controller function takes 3 parameters</p><ul><li><strong>max_gas_gwei, </strong>the maximum gas price that will be used for an airdrop</li><li><strong>multiplier, </strong>used to prioritize our transaction over the current average gas price. Use higher values to speed up transactions.</li><li><strong>sleep_seconds, </strong>the no. of seconds the script will sleep before checking gas prices again.</li></ul><p>The complete code snippet for automated airdrop can be found in our <a href="https://github.com/PartyPenguinsNFT/PartyPenguins/tree/main/airdrop">github</a> repository. <em>Do not blindly copy paste the code snippets, these were modified for demonstration purposes, and are not production level code you can use.</em></p><p><strong>Join the penguin party !!<br></strong>Website: <a href="https://partypenguins.club/">https://partypenguins.club/</a><br>Twitter: <a href="https://twitter.com/PartyPenguinNFT">https://twitter.com/PartyPenguinNFT</a><br>Discord: <a href="https://partypenguins.medium.com/discord.gg/PartyPenguins">https:</a>//<a href="https://t.co/BizP7ICwtL?amp=1">discord.gg/PartyPenguins</a><br>OpenSea: <a href="https://opensea.io/collection/party-penguins">https://opensea.io/collection/party-penguins</a></p><p><strong>Follow the team !!</strong><br>Dev: <a href="https://twitter.com/pengwin_potter">https://twitter.com/pengwin_potter</a><br>Designer: <a href="https://twitter.com/rozi_525">https://twitter.com/rozi_525</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e81a86aa0fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Party Penguins — The Generative Process]]></title>
            <link>https://partypenguins.medium.com/party-penguins-the-generative-process-b05034af495b?source=rss-c0ae154e04c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b05034af495b</guid>
            <category><![CDATA[ethereum-blockchain]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Party Penguins]]></dc:creator>
            <pubDate>Fri, 13 Aug 2021 20:04:04 GMT</pubDate>
            <atom:updated>2021-08-14T13:46:41.575Z</atom:updated>
            <content:encoded><![CDATA[<h3>Party Penguins — The Generative Process</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PP1-pRTl8iFzvJr7cUdnIQ.png" /><figcaption>Party Penguins</figcaption></figure><p>If you would like to understand the gist of building a generative NFT project, this <a href="https://twitter.com/thedigitalvee/status/1408091355105087488">tweet</a> is the best to understand the process. This article goes slightly in depth on the development process we followed for Party Penguins.</p><p>So overall, the steps are as follows</p><ul><li>Get all the asset files properly segregated and named(coded names)</li><li>Define and fix a trait distribution config<em>(rarity of traits)</em></li><li>Use the trait distribution config to generate 10k <strong><em>dna’s</em></strong></li><li>Generate images(combine all assets as given in a dna) for each dna generated in last step</li></ul><p>Each step uses a set of input file/s and generates a set of output file/s which helps keep the whole process modular. We also followed strict naming conventions for traits, output files and folders etc. which made it easier to code it all out.</p><p><strong>Note: </strong><em>This article only talks about the generative pieces we have, we created some 1/1 unique pieces which have some special traits not found in the generative pool.</em></p><h4>Step 1 — Asset files</h4><p>So it all starts with the asset files. You need the <em>components(png’s) </em>of the art piece properly labelled and segregated.</p><p>A Party Penguin has the following traits</p><ul><li>Background(7 values)</li><li>Face(8 values)</li><li>Eyes(30 values)</li><li>Beak(13 values)</li><li>Cheeks(14 values)</li><li>Hat(84 values)</li><li>Clothes(82 values)</li></ul><p>So all the asset files were organized in the following directory structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/235/1*JMjT7FolF7M96PjvlOHHtg.png" /><figcaption>assets directory structure</figcaption></figure><pre>The <em>assets </em>folder has a folder for each component. Component folder names start with a no.(indicates the z index of the trait) followed by the name of the trait/component.</pre><pre>The body component was used as a separate asset for generation, but as there was only 1 value for this, this did not become a final trait of a Party Penguin.</pre><h4>Step 2 — Defining the rarity config</h4><p>We created a <em>traits_config.yml </em>file to define the probability/rarity of each trait value in a particular format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*OZXlGCA_ybrqEHDLA7EGaA.png" /></figure><p>Each trait has it’s own section which lists all possible values(including NONE) for that trait along with the probability. The sum of each trait section should be a multiple of hundred(100, 200, 300 etc.).</p><p>So, in the above example, probability of bkg04 appearing in the pool is 14/100.</p><p>Also, the order of trait sections is the same as the z-indexes. So background comes first, then body, then cheeks etc. Here is the <a href="https://gist.github.com/PartyPenguinsNFT/6b312359285cf15e0ede457632398d53">complete config file</a> we used for rarity distribution.</p><h4>Step 3 — Generating a pool of DNA’s based on a rarity config</h4><p>The input for this step is the <em>traits_config.yml </em>file generated in the last step, and the output is a <em>dna.csv </em>file containing the dna for the complete pool of penguins.</p><p>So, let’s first start with what a dna is. DNA is simply a shorthand for different trait values a penguin is composed of. For example, <a href="https://opensea.io/assets/0x31f3bba9b71cb1d5e96cd62f0ba3958c034b55e9/2347">Penguin #2347</a> has the following properties and dna.</p><pre>{  <br>  &quot;Background&quot;: &quot;Red&quot;,<br>  &quot;Cheeks&quot;:     &quot;Mole&quot;,<br>  &quot;Eyes&quot;:       &quot;Angry&quot;,<br>  &quot;Beak&quot;:       &quot;Cute&quot;,<br>  &quot;Face&quot;:       &quot;Eye Patch&quot;,<br>  &quot;Hat&quot;:        &quot;Bamboo Hat&quot;,<br>  &quot;Clothes&quot;:    &quot;Ocean&quot;<br>}</pre><pre><strong>dna</strong>:bkg01--body01--cheeks13--Eye02--Beak04--face10--hat47--clothes80</pre><p>We used <em>coded values</em> for traits in the generative process which were translated to actual readable names for metadata later. So, <strong>bgk01 translates to Red</strong> for the Background trait.</p><p>The <em>dna.csv </em>had the following format</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528239%252C40%252C44%252C1%2529%26t%3Done-light%26wt%3Dnone%26l%3Dtext%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D85px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D2px%26ph%3D29px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D143%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dserial%25252C00bkg%25252C01body%25252C02cheeks%25252C03eye%25252C04beak%25252C05face%25252C06hat%25252C07clothes%25252Cdna%25250A0%25252Cbkg01%25252Cbody01%25252Ccheeks06%25252CEye04%25252CBeak04%25252CNONE%25252CNONE%25252Cclothes21%25252Cbkg01--body01--cheeks06--Eye04--Beak04--NONE--NONE--clothes21%25250A1%25252Cbkg05%25252Cbody01%25252Ccheeks06%25252CEye02%25252CBeak11%25252CNONE%25252Chat38%25252Cclothes23%25252Cbkg05--body01--cheeks06--Eye02--Beak11--NONE--hat38--clothes23%25250A2%25252Cbkg05%25252Cbody01%25252Ccheeks1%25252CEye23%25252CBeak13%25252CNONE%25252Chat34%25252Cclothes53%25252Cbkg05--body01--cheeks1--Eye23--Beak13--NONE--hat34--clothes53%25250A3%25252Cbkg02%25252Cbody01%25252Ccheeks12%25252CEye19%25252CBeak12%25252CNONE%25252Chat25%25252Cclothes54%25252Cbkg02--body01--cheeks12--Eye19--Beak12--NONE--hat25--clothes54%25250A4%25252Cbkg03%25252Cbody01%25252Ccheeks11%25252CEye19%25252CBeak06%25252CNONE%25252Chat19%25252Cclothes78%25252Cbkg03--body01--cheeks11--Eye19--Beak06--NONE--hat19--clothes78%25250A5%25252Cbkg02%25252Cbody01%25252Ccheeks13%25252CEye06%25252CBeak04%25252Cface07%25252Chat08%25252Cclothes07%25252Cbkg02--body01--cheeks13--Eye06--Beak04--face07--hat08--clothes0&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528239%25252C40%25252C44%25252C1%252529%26t%3Done-light%26wt%3Dnone%26l%3Dtext%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D85px%26wc%3Dtrue%26wa%3Dfalse%26pv%3D2px%26ph%3D29px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D143%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dserial%2525252C00bkg%2525252C01body%2525252C02cheeks%2525252C03eye%2525252C04beak%2525252C05face%2525252C06hat%2525252C07clothes%2525252Cdna%2525250A0%2525252Cbkg01%2525252Cbody01%2525252Ccheeks06%2525252CEye04%2525252CBeak04%2525252CNONE%2525252CNONE%2525252Cclothes21%2525252Cbkg01--body01--cheeks06--Eye04--Beak04--NONE--NONE--clothes21%2525250A1%2525252Cbkg05%2525252Cbody01%2525252Ccheeks06%2525252CEye02%2525252CBeak11%2525252CNONE%2525252Chat38%2525252Cclothes23%2525252Cbkg05--body01--cheeks06--Eye02--Beak11--NONE--hat38--clothes23%2525250A2%2525252Cbkg05%2525252Cbody01%2525252Ccheeks1%2525252CEye23%2525252CBeak13%2525252CNONE%2525252Chat34%2525252Cclothes53%2525252Cbkg05--body01--cheeks1--Eye23--Beak13--NONE--hat34--clothes53%2525250A3%2525252Cbkg02%2525252Cbody01%2525252Ccheeks12%2525252CEye19%2525252CBeak12%2525252CNONE%2525252Chat25%2525252Cclothes54%2525252Cbkg02--body01--cheeks12--Eye19--Beak12--NONE--hat25--clothes54%2525250A4%2525252Cbkg03%2525252Cbody01%2525252Ccheeks11%2525252CEye19%2525252CBeak06%2525252CNONE%2525252Chat19%2525252Cclothes78%2525252Cbkg03--body01--cheeks11--Eye19--Beak06--NONE--hat19--clothes78%2525250A5%2525252Cbkg02%2525252Cbody01%2525252Ccheeks13%2525252CEye06%2525252CBeak04%2525252Cface07%2525252Chat08%2525252Cclothes07%2525252Cbkg02--body01--cheeks13--Eye06--Beak04--face07--hat08--clothes0&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/32a89b57928e94909f51d1fd3b50137e/href">https://medium.com/media/32a89b57928e94909f51d1fd3b50137e/href</a></iframe><p>We used the following ruby script to generate the dna.csv for N items using the rarities described in the config file. The <em>dna.csv</em> file generated formed the basis for the final images, with a few manual tweaks done to the file later.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528239%252C40%252C44%252C1%2529%26t%3Done-light%26wt%3Dnone%26l%3Druby%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D85px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D34px%26ph%3D33px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D143%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Drequire%252520%2527csv%2527%25250Arequire%252520%2527yaml%2527%25250Arequire%252520%2527set%2527%25250A%25250AN%252520%25253D%25252010000%25250ATRAITS_DISTRIBUTION_FILE%252520%25253D%252520%2527traits_config.yml%2527%25250ADNA_FILE%252520%25253D%252520%2527dna.csv%2527%25250A%25250Araw_traits%252520%25253D%252520YAML.load_file%2528TRAITS_DISTRIBUTION_FILE%2529%25255B%2527traits%2527%25255D%25250Atrait_probabilities%252520%25253D%252520raw_traits.transform_values%252520%25257B%252520%25257Cdist_h%25257C%252520dist_h.map%252520%25257B%252520%25257Ck%25252Cv%25257C%252520%25255Bk%25255D%252Av.to_i%252520%25257D.flatten%252520%25257D%25250A%25250A%252523%252520verify%252520that%252520size%252520of%252520all%252520probabilities%252520is%252520100%25250Aif%252520trait_probabilities.values.map%25257B%25257Cv%25257C%252520v.size%252525100%252520%25257D.uniq%252520%2521%25253D%252520%25255B0%25255D%25250A%252520%252520error_traits%252520%25253D%252520trait_probabilities.select%25257B%252520%25257Ck%25252Cv%25257C%252520v.size%252525100%252520%2521%25253D%2525200%252520%25257D%25250A%252520%252520raise%252520%252522Probabilities%252520for%252520these%252520dont%252520match%252520to%252520100%25252C%252520%252523%25257Berror_traits%25257D%252522%25250Aend%25250A%25250Adna_set%252520%25253D%252520Set.new%2528%2529%25250Aserial%252520%25253D%2525200%25250A%25250ACSV.open%2528DNA_FILE%25252C%252520%252522w%252522%2529%252520do%252520%25257Ccsv%25257C%25250A%252520%252520%252523%252520write%252520headers%25250A%252520%252520csv%252520%25253C%25253C%252520%2528%25255B%2527serial%2527%25255D%252520%25252B%252520trait_probabilities.keys%252520%25252B%252520%25255B%2527dna%2527%25255D%2529%25250A%25250A%252520%252520%252523%252520write%252520N%252520unique%252520dna%2527s%25250A%252520%252520loop%252520do%25250A%252520%252520%252520%252520traits%252520%25253D%252520trait_probabilities.values.map%2528%252526%25253Asample%2529%25250A%252520%252520%252520%252520dna%252520%25253D%252520traits.join%2528%2527--%2527%2529%25250A%25250A%252520%252520%252520%252520unless%252520dna_set.include%25253F%2528dna%2529%25250A%252520%252520%252520%252520%252520%252520csv%252520%25253C%25253C%252520%25255Bserial%25255D%252520%25252B%252520traits%252520%25252B%252520%25255Bdna%25255D%25250A%252520%252520%252520%252520%252520%252520dna_set.add%2528dna%2529%25250A%252520%252520%252520%252520%252520%252520serial%252520%25252B%25253D%2525201%25250A%252520%252520%252520%252520%252520%252520break%252520if%252520serial%252520%25253D%25253D%252520N%25250A%252520%252520%252520%252520end%25250A%252520%252520end%25250Aend&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528239%25252C40%25252C44%25252C1%252529%26t%3Done-light%26wt%3Dnone%26l%3Druby%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D85px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D34px%26ph%3D33px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D143%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Drequire%25252520%252527csv%252527%2525250Arequire%25252520%252527yaml%252527%2525250Arequire%25252520%252527set%252527%2525250A%2525250AN%25252520%2525253D%2525252010000%2525250ATRAITS_DISTRIBUTION_FILE%25252520%2525253D%25252520%252527traits_config.yml%252527%2525250ADNA_FILE%25252520%2525253D%25252520%252527dna.csv%252527%2525250A%2525250Araw_traits%25252520%2525253D%25252520YAML.load_file%252528TRAITS_DISTRIBUTION_FILE%252529%2525255B%252527traits%252527%2525255D%2525250Atrait_probabilities%25252520%2525253D%25252520raw_traits.transform_values%25252520%2525257B%25252520%2525257Cdist_h%2525257C%25252520dist_h.map%25252520%2525257B%25252520%2525257Ck%2525252Cv%2525257C%25252520%2525255Bk%2525255D%25252Av.to_i%25252520%2525257D.flatten%25252520%2525257D%2525250A%2525250A%25252523%25252520verify%25252520that%25252520size%25252520of%25252520all%25252520probabilities%25252520is%25252520100%2525250Aif%25252520trait_probabilities.values.map%2525257B%2525257Cv%2525257C%25252520v.size%25252525100%25252520%2525257D.uniq%25252520%252521%2525253D%25252520%2525255B0%2525255D%2525250A%25252520%25252520error_traits%25252520%2525253D%25252520trait_probabilities.select%2525257B%25252520%2525257Ck%2525252Cv%2525257C%25252520v.size%25252525100%25252520%252521%2525253D%252525200%25252520%2525257D%2525250A%25252520%25252520raise%25252520%25252522Probabilities%25252520for%25252520these%25252520dont%25252520match%25252520to%25252520100%2525252C%25252520%25252523%2525257Berror_traits%2525257D%25252522%2525250Aend%2525250A%2525250Adna_set%25252520%2525253D%25252520Set.new%252528%252529%2525250Aserial%25252520%2525253D%252525200%2525250A%2525250ACSV.open%252528DNA_FILE%2525252C%25252520%25252522w%25252522%252529%25252520do%25252520%2525257Ccsv%2525257C%2525250A%25252520%25252520%25252523%25252520write%25252520headers%2525250A%25252520%25252520csv%25252520%2525253C%2525253C%25252520%252528%2525255B%252527serial%252527%2525255D%25252520%2525252B%25252520trait_probabilities.keys%25252520%2525252B%25252520%2525255B%252527dna%252527%2525255D%252529%2525250A%2525250A%25252520%25252520%25252523%25252520write%25252520N%25252520unique%25252520dna%252527s%2525250A%25252520%25252520loop%25252520do%2525250A%25252520%25252520%25252520%25252520traits%25252520%2525253D%25252520trait_probabilities.values.map%252528%25252526%2525253Asample%252529%2525250A%25252520%25252520%25252520%25252520dna%25252520%2525253D%25252520traits.join%252528%252527--%252527%252529%2525250A%2525250A%25252520%25252520%25252520%25252520unless%25252520dna_set.include%2525253F%252528dna%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520csv%25252520%2525253C%2525253C%25252520%2525255Bserial%2525255D%25252520%2525252B%25252520traits%25252520%2525252B%25252520%2525255Bdna%2525255D%2525250A%25252520%25252520%25252520%25252520%25252520%25252520dna_set.add%252528dna%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520serial%25252520%2525252B%2525253D%252525201%2525250A%25252520%25252520%25252520%25252520%25252520%25252520break%25252520if%25252520serial%25252520%2525253D%2525253D%25252520N%2525250A%25252520%25252520%25252520%25252520end%2525250A%25252520%25252520end%2525250Aend&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b58d601cd15ddd06a61e63a78cfd1a42/href">https://medium.com/media/b58d601cd15ddd06a61e63a78cfd1a42/href</a></iframe><pre>The script above is a simplistic version which assumes all trait combinations are valid. The actual version also includes avoiding certain geometrical exceptions while combining the traits.</pre><pre>For example, hat29 can&#39;t go with eye21, eye24 etc.</pre><p>If you’re generating the <em>dna.csv</em> using any other method, it’s important to follow the conventions given below as these become assumptions for step 4</p><ul><li>The headers have exact names as the traits(<em>folders in assets directory</em>) , and the trait values follow the exact names as the <em>files</em> in the assets directory.</li><li>The order of columns is same as the z-index</li></ul><p>To run the script, simply run ruby generate_dna_simple.rb in a terminal.</p><h4>Step 4 — Generating images from the assets and dna.csv</h4><p>The input for this step is the dna.csv, and the output is the final png files.</p><p>We used python3 and the pillow library to generate all the images.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fcarbon.now.sh%2Fembed%3Fbg%3Drgba%2528239%252C40%252C44%252C1%2529%26t%3Done-light%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D85px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D39px%26ph%3D29px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D143%2525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dfrom%252520PIL%252520import%252520Image%25250Aimport%252520csv%25250Aimport%252520time%25250Aimport%252520os%25250Afrom%252520multiprocessing%252520import%252520Pool%25250A%25250Aoverride%252520%25253D%252520True%25250Aasset_folder%252520%25253D%252520%252522assets%252522%25250Adna_file%252520%25253D%252520%252522dna.csv%252522%25250Aoutput_folder%252520%25253D%252520%252522output%252522%25250A%25250A%252523%252520given%252520a%252520serial%252520no.%252520and%252520asset%252520files%25252C%252520composes%252520and%252520saves%252520an%252520image%25250Adef%252520generate_img%2528params%2529%25253A%25250A%252520%252520%252520%252520try%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520serial_no%25252C%252520traits%252520%25253D%252520params%25250A%252520%252520%252520%252520%252520%252520%252520%252520if%252520not%252520override%252520and%252520f%2527%25257Bserial_no%25257D.png%2527%252520in%252520existing_images%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520print%2528f%252522Skipping%252520image%252520%252523%25257Bserial_no%25257D%252522%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520return%25250A%252520%252520%252520%252520%252520%252520%252520%252520all_assets%252520%25253D%252520%25255BImage.open%2528f%2527%25257Basset_folder%25257D%25252F%25257Btrait%25257D.png%2527%2529%252520for%252520trait%252520in%252520traits%25255D%25250A%252520%252520%252520%252520%252520%252520%252520%252520base_image%252520%25253D%252520all_assets%25255B0%25255D%25250A%252520%252520%252520%252520%252520%252520%252520%252520for%252520img%252520in%252520all_assets%25255B1%25253A%25255D%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520base_image.paste%2528img%25252C%252520%25280%25252C%2525200%2529%25252C%252520img%2529%25250A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520base_image.save%2528f%2527%25257Boutput_folder%25257D%25252F%25257Bserial_no%25257D.png%2527%25252C%252520%2527PNG%2527%2529%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520print%2528f%252522Generated%252520image%252520%252523%25257Bserial_no%25257D%252522%2529%25250A%252520%252520%252520%252520except%252520Exception%252520as%252520ex%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520print%2528f%252522Failed%252520for%252520%25257Bserial_no%25257D%25252C%252520with%252520exception%25253A%252520%25257Bex%25257D%252522%2529%25250A%25250A%252523%252520read%252520all%252520the%252520dna%2527s%25250Adnas%252520%25253D%252520%25255B%25255D%25250Awith%252520open%2528dna_file%25252C%252520mode%25253D%2527r%2527%2529%252520as%252520csv_file%25253A%25250A%252520%252520%252520%252520csv_reader%252520%25253D%252520csv.DictReader%2528csv_file%2529%25250A%252520%252520%252520%252520for%252520row%252520in%252520csv_reader%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520dnas.append%2528row%2529%25250A%25250Acolumns%252520%25253D%252520list%2528dnas%25255B0%25255D.keys%2528%2529%2529%25250Aall_params%252520%25253D%252520%25255B%25255D%25250A%25250Arootdir%252520%25253D%252520os.getcwd%2528%2529%25250Aexisting_images%252520%25253D%252520%25255B%25255D%25250Afor%252520subdir%25252C%252520dirs%25252C%252520files%252520in%252520os.walk%2528rootdir%2529%25253A%25250A%252520%252520%252520%252520for%252520file%252520in%252520files%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520if%252520output_folder%252520in%252520subdir%252520and%252520file.endswith%2528%252522.png%252522%2529%25253A%25250A%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520%252520existing_images.append%2528file%2529%25250A%25250Afor%252520dna%252520in%252520dnas%25253A%25250A%252520%252520%252520%252520traits%252520%25253D%252520%25255Bf%2527%25257Bkey%25257D%25252F%25257Bdna%25255Bkey%25255D%25257D%2527%252520for%252520key%252520in%252520columns%252520if%252520key%252520not%252520in%252520set%2528%25255B%2527serial%2527%25252C%252520%2527dna%2527%25255D%2529%252520and%252520dna%25255Bkey%25255D%2521%25253D%252520%2527NONE%2527%25255D%25250A%25250A%252520%252520%252520%252520trait_vals%252520%25253D%252520%25255Bt.split%2528%2527%25252F%2527%2529%25255B-1%25255D%252520for%252520t%252520in%252520traits%25255D%25250A%252520%252520%252520%252520all_params.append%2528%25255Bdna%25255B%2527serial%2527%25255D%25252C%252520traits%25255D%2529%25250A%25250Aif%252520__name__%252520%25253D%25253D%252520%252522__main__%252522%25253A%25250A%252520%252520%252520%252520pool%252520%25253D%252520Pool%2528%2529%25250A%252520%252520%252520%252520tic%252520%25253D%252520time.perf_counter%2528%2529%25250A%252520%252520%252520%252520pool.map%2528generate_img%25252C%252520all_params%2529%25250A%252520%252520%252520%252520pool.close%2528%2529%25250A%252520%252520%252520%252520toc%252520%25253D%252520time.perf_counter%2528%2529%25250A%252520%252520%252520%252520print%2528f%252522Total%252520time%252520taken%252520to%252520process%252520%25257Blen%2528dnas%2529%25257D%252520dnas%252520is%252520%25257Btoc%252520-%252520tic%25253A0.4f%25257D%252520seconds%252522%2529&amp;display_name=Carbon&amp;url=https%3A%2F%2Fcarbon.now.sh%2F%3Fbg%3Drgba%252528239%25252C40%25252C44%25252C1%252529%26t%3Done-light%26wt%3Dnone%26l%3Dpython%26ds%3Dtrue%26dsyoff%3D20px%26dsblur%3D85px%26wc%3Dtrue%26wa%3Dtrue%26pv%3D39px%26ph%3D29px%26ln%3Dtrue%26fl%3D1%26fm%3DHack%26fs%3D14px%26lh%3D143%252525%26si%3Dfalse%26es%3D2x%26wm%3Dfalse%26code%3Dfrom%25252520PIL%25252520import%25252520Image%2525250Aimport%25252520csv%2525250Aimport%25252520time%2525250Aimport%25252520os%2525250Afrom%25252520multiprocessing%25252520import%25252520Pool%2525250A%2525250Aoverride%25252520%2525253D%25252520True%2525250Aasset_folder%25252520%2525253D%25252520%25252522assets%25252522%2525250Adna_file%25252520%2525253D%25252520%25252522dna.csv%25252522%2525250Aoutput_folder%25252520%2525253D%25252520%25252522output%25252522%2525250A%2525250A%25252523%25252520given%25252520a%25252520serial%25252520no.%25252520and%25252520asset%25252520files%2525252C%25252520composes%25252520and%25252520saves%25252520an%25252520image%2525250Adef%25252520generate_img%252528params%252529%2525253A%2525250A%25252520%25252520%25252520%25252520try%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520serial_no%2525252C%25252520traits%25252520%2525253D%25252520params%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520if%25252520not%25252520override%25252520and%25252520f%252527%2525257Bserial_no%2525257D.png%252527%25252520in%25252520existing_images%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520print%252528f%25252522Skipping%25252520image%25252520%25252523%2525257Bserial_no%2525257D%25252522%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520return%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520all_assets%25252520%2525253D%25252520%2525255BImage.open%252528f%252527%2525257Basset_folder%2525257D%2525252F%2525257Btrait%2525257D.png%252527%252529%25252520for%25252520trait%25252520in%25252520traits%2525255D%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520base_image%25252520%2525253D%25252520all_assets%2525255B0%2525255D%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520for%25252520img%25252520in%25252520all_assets%2525255B1%2525253A%2525255D%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520base_image.paste%252528img%2525252C%25252520%2525280%2525252C%252525200%252529%2525252C%25252520img%252529%2525250A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520base_image.save%252528f%252527%2525257Boutput_folder%2525257D%2525252F%2525257Bserial_no%2525257D.png%252527%2525252C%25252520%252527PNG%252527%252529%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520print%252528f%25252522Generated%25252520image%25252520%25252523%2525257Bserial_no%2525257D%25252522%252529%2525250A%25252520%25252520%25252520%25252520except%25252520Exception%25252520as%25252520ex%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520print%252528f%25252522Failed%25252520for%25252520%2525257Bserial_no%2525257D%2525252C%25252520with%25252520exception%2525253A%25252520%2525257Bex%2525257D%25252522%252529%2525250A%2525250A%25252523%25252520read%25252520all%25252520the%25252520dna%252527s%2525250Adnas%25252520%2525253D%25252520%2525255B%2525255D%2525250Awith%25252520open%252528dna_file%2525252C%25252520mode%2525253D%252527r%252527%252529%25252520as%25252520csv_file%2525253A%2525250A%25252520%25252520%25252520%25252520csv_reader%25252520%2525253D%25252520csv.DictReader%252528csv_file%252529%2525250A%25252520%25252520%25252520%25252520for%25252520row%25252520in%25252520csv_reader%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520dnas.append%252528row%252529%2525250A%2525250Acolumns%25252520%2525253D%25252520list%252528dnas%2525255B0%2525255D.keys%252528%252529%252529%2525250Aall_params%25252520%2525253D%25252520%2525255B%2525255D%2525250A%2525250Arootdir%25252520%2525253D%25252520os.getcwd%252528%252529%2525250Aexisting_images%25252520%2525253D%25252520%2525255B%2525255D%2525250Afor%25252520subdir%2525252C%25252520dirs%2525252C%25252520files%25252520in%25252520os.walk%252528rootdir%252529%2525253A%2525250A%25252520%25252520%25252520%25252520for%25252520file%25252520in%25252520files%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520if%25252520output_folder%25252520in%25252520subdir%25252520and%25252520file.endswith%252528%25252522.png%25252522%252529%2525253A%2525250A%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520%25252520existing_images.append%252528file%252529%2525250A%2525250Afor%25252520dna%25252520in%25252520dnas%2525253A%2525250A%25252520%25252520%25252520%25252520traits%25252520%2525253D%25252520%2525255Bf%252527%2525257Bkey%2525257D%2525252F%2525257Bdna%2525255Bkey%2525255D%2525257D%252527%25252520for%25252520key%25252520in%25252520columns%25252520if%25252520key%25252520not%25252520in%25252520set%252528%2525255B%252527serial%252527%2525252C%25252520%252527dna%252527%2525255D%252529%25252520and%25252520dna%2525255Bkey%2525255D%252521%2525253D%25252520%252527NONE%252527%2525255D%2525250A%2525250A%25252520%25252520%25252520%25252520trait_vals%25252520%2525253D%25252520%2525255Bt.split%252528%252527%2525252F%252527%252529%2525255B-1%2525255D%25252520for%25252520t%25252520in%25252520traits%2525255D%2525250A%25252520%25252520%25252520%25252520all_params.append%252528%2525255Bdna%2525255B%252527serial%252527%2525255D%2525252C%25252520traits%2525255D%252529%2525250A%2525250Aif%25252520__name__%25252520%2525253D%2525253D%25252520%25252522__main__%25252522%2525253A%2525250A%25252520%25252520%25252520%25252520pool%25252520%2525253D%25252520Pool%252528%252529%2525250A%25252520%25252520%25252520%25252520tic%25252520%2525253D%25252520time.perf_counter%252528%252529%2525250A%25252520%25252520%25252520%25252520pool.map%252528generate_img%2525252C%25252520all_params%252529%2525250A%25252520%25252520%25252520%25252520pool.close%252528%252529%2525250A%25252520%25252520%25252520%25252520toc%25252520%2525253D%25252520time.perf_counter%252528%252529%2525250A%25252520%25252520%25252520%25252520print%252528f%25252522Total%25252520time%25252520taken%25252520to%25252520process%25252520%2525257Blen%252528dnas%252529%2525257D%25252520dnas%25252520is%25252520%2525257Btoc%25252520-%25252520tic%2525253A0.4f%2525257D%25252520seconds%25252522%252529&amp;image=https%3A%2F%2Fcarbon.now.sh%2Fstatic%2Fbrand%2Fbanner.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;scroll=auto&amp;schema=carbon" width="1024" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3ba878801529d088cc74dcb1daac0fc/href">https://medium.com/media/f3ba878801529d088cc74dcb1daac0fc/href</a></iframe><p>The script uses multi processing to speed up the process and also has an override flag, which if set to <em>False</em>, doesn’t generate the output files which are already present in the output folder. This is useful when the script fails for some reason and you have to start it again, or when some of the asset files are updated and you selectively run the generation.</p><p>To run the script, simply run python3 generate_penguin.py in a terminal.</p><p>The above code snippets for image generation can be found in our <a href="https://github.com/PartyPenguinsNFT/PartyPenguins/tree/main/generation">github</a> repository. <em>Do not blindly copy paste the code snippets, these were modified for demonstration purposes, and are not production level code you can use.</em></p><p><strong>Join the penguin party !!<br></strong>Website: <a href="https://partypenguins.club/">https://partypenguins.club/</a><br>Twitter: <a href="https://twitter.com/PartyPenguinNFT">https://twitter.com/PartyPenguinNFT</a><br>Discord: <a href="https://medium.com/discord.gg/PartyPenguins">https:</a>//<a href="https://t.co/BizP7ICwtL?amp=1">discord.gg/PartyPenguins</a><br>OpenSea: <a href="https://opensea.io/collection/party-penguins">https://opensea.io/collection/party-penguins</a></p><p><strong>Follow the team !!</strong><br>Dev: <a href="https://twitter.com/pengwin_potter">https://twitter.com/pengwin_potter</a><br>Designer: <a href="https://twitter.com/rozi_525">https://twitter.com/rozi_525</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b05034af495b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>