<?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>Forem: ViperT</title>
    <description>The latest articles on Forem by ViperT (@vipert).</description>
    <link>https://forem.com/vipert</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F848632%2Fe16d7586-00a9-47ed-aa23-d5e0220891bc.png</url>
      <title>Forem: ViperT</title>
      <link>https://forem.com/vipert</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vipert"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Wed, 19 Feb 2025 18:06:51 +0000</pubDate>
      <link>https://forem.com/vipert/-312a</link>
      <guid>https://forem.com/vipert/-312a</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/vipert" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F848632%2Fe16d7586-00a9-47ed-aa23-d5e0220891bc.png" alt="vipert"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/vipert/blockchain-social-media-platform-reactjs-ui-tips-and-tricks-57c0" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;🚀 Blockchain Social Media Platform - ReactJS UI - Tips and Tricks!&lt;/h2&gt;
      &lt;h3&gt;ViperT ・ Feb 19&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#webdev&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#blockchain&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#frontend&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>blockchain</category>
      <category>frontend</category>
    </item>
    <item>
      <title>🚀 Blockchain Social Media Platform - ReactJS UI - Tips and Tricks!</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Wed, 19 Feb 2025 17:56:09 +0000</pubDate>
      <link>https://forem.com/vipert/blockchain-social-media-platform-reactjs-ui-tips-and-tricks-57c0</link>
      <guid>https://forem.com/vipert/blockchain-social-media-platform-reactjs-ui-tips-and-tricks-57c0</guid>
      <description>&lt;p&gt;Hello everyone! 👋&lt;/p&gt;

&lt;p&gt;How's your coding journey going so far? I hope you're doing great! My name is &lt;strong&gt;Matias Affolter&lt;/strong&gt;, and I'm excited to share insights into the project I’ve been working on during 2024 and beyond.&lt;/p&gt;

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

&lt;h1&gt;
  
  
  🌍 Building a Business &amp;amp; Blockchain-Powered Social Media
&lt;/h1&gt;

&lt;p&gt;While I love coding, I had to step away from full-time frontend development to &lt;strong&gt;run a business&lt;/strong&gt; and establish a &lt;strong&gt;company in Switzerland&lt;/strong&gt;. Setting up a Swiss company requires around &lt;strong&gt;$120,000 in capital&lt;/strong&gt;, but the good part is that you can contribute &lt;strong&gt;intellectual property&lt;/strong&gt;, such as software. That’s how my previous project, &lt;a href="https://pixa.pics" rel="noopener noreferrer"&gt;Pixa.pics&lt;/a&gt;, which allows users to draw &lt;strong&gt;pixel art on the web&lt;/strong&gt;, became an &lt;strong&gt;asset for the company&lt;/strong&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  🏛️ The Blockchain Foundation
&lt;/h2&gt;

&lt;p&gt;Did you ever hear about &lt;strong&gt;STEEM&lt;/strong&gt; or &lt;strong&gt;HIVE&lt;/strong&gt;? These blockchains were among the &lt;strong&gt;top 10&lt;/strong&gt; in 2017, some reaching a &lt;strong&gt;$1 billion market cap&lt;/strong&gt;! They feature a &lt;strong&gt;super-fast 3-second block time&lt;/strong&gt; and use a &lt;strong&gt;layer-1 distributed ledger&lt;/strong&gt; fully governed by &lt;strong&gt;decentralized consensus&lt;/strong&gt;. Inspired by high-speed transaction processing in online gaming, &lt;strong&gt;Dan Larimer&lt;/strong&gt; developed &lt;strong&gt;Graphene&lt;/strong&gt;, a technology capable of handling &lt;strong&gt;300,000 transactions per second&lt;/strong&gt;, surpassing &lt;strong&gt;Visa and Mastercard combined&lt;/strong&gt;! 🤯&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 Why Store Pixel Art on the Blockchain?
&lt;/h2&gt;

&lt;p&gt;A year ago, I decided to &lt;strong&gt;fork STEEM/HIVE&lt;/strong&gt; and integrate &lt;strong&gt;on-chain pixel art storage&lt;/strong&gt; as &lt;strong&gt;NFTs&lt;/strong&gt;! Unlike most NFTs (which store only a hash), &lt;strong&gt;our blockchain stores the actual pixel art in Base64&lt;/strong&gt;. This means &lt;strong&gt;the data remains immutable forever&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;💡 Storing 30kB of pixel art on &lt;strong&gt;Ethereum&lt;/strong&gt; could cost &lt;strong&gt;thousands of dollars&lt;/strong&gt;—on our fork, it’s &lt;strong&gt;fast and efficient&lt;/strong&gt;! With &lt;strong&gt;21 primary nodes (witnesses)&lt;/strong&gt; ensuring redundancy, our solution can scale to &lt;strong&gt;millions of users&lt;/strong&gt;. Beyond that, &lt;strong&gt;sharding&lt;/strong&gt; would be necessary, but it's &lt;strong&gt;technically feasible&lt;/strong&gt;. &lt;/p&gt;

&lt;h1&gt;
  
  
  🖥️ ReactJS UI - Essential Tips and Tricks 🛠️
&lt;/h1&gt;

&lt;p&gt;I’m building the &lt;strong&gt;Pixagram&lt;/strong&gt; UI in &lt;strong&gt;ReactJS&lt;/strong&gt;. Here are some impactful tips for optimizing &lt;strong&gt;CSS, HTML, and JavaScript&lt;/strong&gt;:&lt;/p&gt;

&lt;h2&gt;
  
  
  🎨 1. Homepage Animations &amp;amp; Graphics
&lt;/h2&gt;

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

&lt;p&gt;✅ Use &lt;strong&gt;CSS gradients&lt;/strong&gt; and &lt;strong&gt;SVGs&lt;/strong&gt; instead of raster images—they are &lt;strong&gt;lightweight and scalable&lt;/strong&gt;.&lt;br&gt;
✅ Check out the &lt;strong&gt;fading rainbow effect&lt;/strong&gt; on &lt;a href="https://pixagram.io" rel="noopener noreferrer"&gt;Pixagram.io&lt;/a&gt; 🌈&lt;/p&gt;

&lt;h3&gt;
  
  
  📸 2. Handling Images Efficiently
&lt;/h3&gt;

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

&lt;p&gt;✅ &lt;strong&gt;Pixel art needs upscaling, not downscaling&lt;/strong&gt;—use &lt;strong&gt;Canvas API&lt;/strong&gt; instead of HTML &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; for rendering.&lt;br&gt;
✅ &lt;strong&gt;Use &lt;code&gt;react-virtualized&lt;/code&gt;&lt;/strong&gt; to handle large lists of posts &lt;strong&gt;smoothly&lt;/strong&gt;.&lt;br&gt;
✅ &lt;strong&gt;Lazy-load&lt;/strong&gt; content with &lt;strong&gt;Webpack chunk splitting&lt;/strong&gt; for better performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  🖌️ 3. Pixel Art Upscaling - WebGL &amp;amp; XBRZ
&lt;/h3&gt;

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

&lt;p&gt;✅ &lt;strong&gt;Hexagonal rendering engine&lt;/strong&gt; (Canvas2D) was slow—&lt;strong&gt;WebGL shaders&lt;/strong&gt; are better.&lt;br&gt;
✅ &lt;strong&gt;XBRZ algorithm&lt;/strong&gt; can upscale &lt;strong&gt;pixel art by 6x&lt;/strong&gt; into smooth shapes &lt;strong&gt;without AI&lt;/strong&gt;.&lt;br&gt;
✅ Runs in a &lt;strong&gt;worker thread&lt;/strong&gt;, making it &lt;strong&gt;fast &amp;amp; deterministic&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  🤖 4. AI-Powered Pixel Art
&lt;/h3&gt;

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

&lt;p&gt;✅ We use &lt;strong&gt;Hugging Face AI&lt;/strong&gt; to &lt;strong&gt;generate pixel art from selfies&lt;/strong&gt;.&lt;br&gt;
✅ &lt;strong&gt;Color quantization&lt;/strong&gt; ensures pixel art remains &lt;strong&gt;authentic &amp;amp; lightweight&lt;/strong&gt;.&lt;br&gt;
✅ &lt;strong&gt;WebP format&lt;/strong&gt; &amp;gt; PNG (smaller file size, same quality).&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 5. Sorting Colors Smartly
&lt;/h3&gt;

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

&lt;p&gt;✅ Sorting &lt;strong&gt;colors in RGB space&lt;/strong&gt; requires sorting &lt;strong&gt;3D vectors&lt;/strong&gt;.&lt;br&gt;
✅ &lt;strong&gt;Z-order curve&lt;/strong&gt; and &lt;strong&gt;Hilbert curve&lt;/strong&gt; are optimal for sorting &lt;strong&gt;color palettes&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚡ 6. CSS Performance Optimizations
&lt;/h3&gt;

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

&lt;p&gt;✅ Use &lt;strong&gt;&lt;code&gt;transform&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;effects&lt;/code&gt;&lt;/strong&gt; instead of &lt;code&gt;opacity&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt;, or &lt;code&gt;top&lt;/code&gt;—they run &lt;strong&gt;on the GPU&lt;/strong&gt; for &lt;strong&gt;smoother animations&lt;/strong&gt;.&lt;br&gt;
✅ Apply &lt;strong&gt;&lt;code&gt;contain&lt;/code&gt;&lt;/strong&gt; to prevent &lt;strong&gt;layout recalculations&lt;/strong&gt; and improve &lt;strong&gt;render performance&lt;/strong&gt;.&lt;br&gt;
✅ &lt;strong&gt;&lt;code&gt;will-change&lt;/code&gt;&lt;/strong&gt; optimizations: Set it &lt;strong&gt;right before an animation starts&lt;/strong&gt; and &lt;strong&gt;remove it after&lt;/strong&gt; to avoid slowdowns.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔥 7. React Rendering &amp;amp; Hydration
&lt;/h3&gt;

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

&lt;p&gt;✅ &lt;strong&gt;Use PureComponent&lt;/strong&gt; to &lt;strong&gt;prevent unnecessary re-renders&lt;/strong&gt;.&lt;br&gt;
✅ &lt;strong&gt;No automatic hydration&lt;/strong&gt;—everything is handled &lt;strong&gt;deterministically&lt;/strong&gt; for better &lt;strong&gt;performance&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This project is a &lt;strong&gt;blend of blockchain, pixel art, and AI&lt;/strong&gt;—a unique combination that makes &lt;strong&gt;Pixagram&lt;/strong&gt; an innovative platform. We’re currently working towards &lt;strong&gt;government approval&lt;/strong&gt; for fundraising, and once that’s set, we’re rolling out &lt;strong&gt;big updates&lt;/strong&gt;! 🚀&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pixagram.io/" rel="noopener noreferrer"&gt;https://pixagram.io/&lt;/a&gt; (DEMO)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://vimeo.com/1058112712" rel="noopener noreferrer"&gt;https://vimeo.com/1058112712&lt;/a&gt; (VIDEO)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://tinyurl.com/pixadata" rel="noopener noreferrer"&gt;https://tinyurl.com/pixadata&lt;/a&gt; (WHITEPAPER &amp;amp; PITCH DECK)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/company/pixagram-blockchain/" rel="noopener noreferrer"&gt;https://www.linkedin.com/company/pixagram-blockchain/&lt;/a&gt; (LINKEDIN)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know what you think! Do you have &lt;strong&gt;other performance tricks&lt;/strong&gt; you use in your &lt;strong&gt;React projects&lt;/strong&gt;? Drop them in the comments below! 💬👇&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>blockchain</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Are Algorithms a Threat to Democracy? Understanding the Impact of Digital Intermediaries</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Sat, 06 Jan 2024 07:00:01 +0000</pubDate>
      <link>https://forem.com/vipert/are-algorithms-a-threat-to-democracy-understanding-the-impact-of-digital-intermediaries-glg</link>
      <guid>https://forem.com/vipert/are-algorithms-a-threat-to-democracy-understanding-the-impact-of-digital-intermediaries-glg</guid>
      <description>&lt;p&gt;The document "Governing Platforms - Are Algorithms a Threat to Democracy? The Rise of Intermediaries: A Challenge for Public Discourse" by Professor Dr. Birgit Stark, Daniel Stegmann M.A., Melanie Magin Assoc. Prof., and Dr. Pascal Jürgens, published on May 26, 2020, as part of the Governing Platforms research project, delves into the impact of algorithms and intermediaries, such as social media platforms, on public discourse and democracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In an era where digital platforms govern our access to information, the pivotal question arises: Are algorithms enhancing or endangering our democratic processes? This post delves deep into the intricate dynamics between digital intermediaries and democracy, based on the comprehensive insights from the "Governing Platforms" study. Join us as we unravel the complexities of this digital conundrum.&lt;/p&gt;

&lt;h2&gt;
  
  
  Information Filtering and Democracy
&lt;/h2&gt;

&lt;p&gt;The digital age has brought about a significant shift in how information is curated and consumed, raising critical questions about the impact of algorithms on democracy. &lt;strong&gt;Filter Bubbles and Echo Chambers&lt;/strong&gt; often dominate the discourse, with concerns that algorithmic curation leads to information silos. However, the reality might be less dire. Studies indicate that the effect of these bubbles is overstated, suggesting a more complex interaction between users and information. &lt;strong&gt;The Role of Algorithms&lt;/strong&gt; in shaping our information landscape is undeniable, yet it's crucial to distinguish between the potential risks and actual impact. &lt;strong&gt;Democracy and Diverse Opinions&lt;/strong&gt; thrive on exposure to varying viewpoints. While algorithms might narrow our view, they also have the potential to introduce a wide array of perspectives, challenging the notion that they inherently undermine democratic discourse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Empirical Studies on Algorithmic Personalization
&lt;/h2&gt;

&lt;p&gt;Algorithmic personalization, a cornerstone of social media platforms, plays a pivotal role in shaping user experience. &lt;strong&gt;Diverse Information Repertoires&lt;/strong&gt; highlight that users are often exposed to a broad spectrum of content, contrary to the belief that algorithms always limit perspective diversity. &lt;strong&gt;Affective Polarization&lt;/strong&gt;, however, emerges as a concern. While users encounter diverse opinions, the way social media platforms function can intensify emotional responses towards opposing views, fostering negative stereotypes. &lt;strong&gt;Understanding User Behavior&lt;/strong&gt; in the context of these platforms is essential. It's not just about the algorithms themselves, but also how users interact with them, leading to a nuanced understanding of the role of algorithmic personalization in society.&lt;/p&gt;

&lt;h2&gt;
  
  
  Social Media’s Role in Polarization and Disinformation
&lt;/h2&gt;

&lt;p&gt;Social media's influence on public opinion and societal polarization is multifaceted. Indirect Contribution to Polarization arises from the platforms' propensity to present a skewed perception of public opinion. &lt;strong&gt;Disinformation Campaigns&lt;/strong&gt; exacerbate this issue, although their actual reach might be more limited than perceived. The role of social media in &lt;strong&gt;Spreading Disinformation&lt;/strong&gt; is a complex interplay between user behavior, platform algorithms, and external actors. Understanding this dynamic is crucial for developing strategies to mitigate the negative impacts on public discourse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Algorithmic Gatekeeping vs. Human Gatekeeping
&lt;/h2&gt;

&lt;p&gt;The shift from human editorial processes to &lt;strong&gt;Algorithmic Gatekeeping&lt;/strong&gt; marks a significant change in how information is prioritized and presented. &lt;strong&gt;Personal Significance vs. Social Significance&lt;/strong&gt;: Algorithms tend to focus on what is most engaging to the individual, a stark contrast to traditional journalistic values that emphasize societal relevance. &lt;strong&gt;Evaluating the Impacts&lt;/strong&gt; of this shift is critical. While algorithmic curation can offer personalized content, it may also sideline important societal issues, raising questions about the balance between personal relevance and public interest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges for Traditional Media and Public Discourse
&lt;/h2&gt;

&lt;p&gt;The rise of algorithmic curation presents &lt;strong&gt;New Challenges for Traditional Media&lt;/strong&gt;, which must adapt to remain relevant in a changing landscape. &lt;strong&gt;The Quality of Public Discourse&lt;/strong&gt; is at stake, with concerns over the trivialization of news and the spread of misinformation. &lt;strong&gt;Combatting Hate Speech and Incivility&lt;/strong&gt; becomes increasingly difficult in an environment where sensational and divisive content often gains traction. These challenges require innovative approaches to ensure that traditional media can continue to play a vital role in informing the public and fostering healthy discourse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Opinion Formation in the Digital Age
&lt;/h2&gt;

&lt;p&gt;In the digital age, &lt;strong&gt;Intermediaries like Social Media Platforms&lt;/strong&gt; have become key players in news dissemination. &lt;strong&gt;Shaping News Production and Consumption&lt;/strong&gt;: Their algorithms significantly influence what news is seen and shared, affecting public opinion formation. &lt;strong&gt;Adapting to New Realities&lt;/strong&gt;: It's essential to understand how these changes impact the broader societal context and what it means for the future of informed citizenry in a democratic society.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommendations for Future Research
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Understanding Algorithmic Personalization&lt;/strong&gt;: More research is needed to fully grasp the extent of its impact on society. &lt;strong&gt;Regulatory Measures and Transparency&lt;/strong&gt; are vital to ensure that algorithms serve the public interest without compromising democratic values. &lt;strong&gt;Maintaining a Healthy Democratic Discourse&lt;/strong&gt;: There is a pressing need for policies and practices that promote diversity and transparency in the digital information ecosystem.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As we navigate the intricate web of algorithms and democracy, it becomes clear that this is not just a technological issue, but a societal one at its core. The balance between algorithmic efficiency and democratic integrity is delicate and demands our continuous attention and action. By fostering a deeper understanding and advocating for transparency and regulation, we can harness the power of digital intermediaries to enhance, rather than endanger, our democratic processes. The future of our democracy may very well depend on how we choose to govern these digital platforms.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JOYSON, CBOR, BSON, JSON - Advanced Data Serialization</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Mon, 25 Dec 2023 02:04:56 +0000</pubDate>
      <link>https://forem.com/vipert/joyson-cbor-bson-json-advanced-data-serialization-1m0l</link>
      <guid>https://forem.com/vipert/joyson-cbor-bson-json-advanced-data-serialization-1m0l</guid>
      <description>&lt;p&gt;In the dynamic world of web development, the efficient handling of complex data structures during network transmission has become increasingly vital. JavaScript's ecosystem offers a plethora of data serialization modules, each tailored with unique capabilities. In this comprehensive exploration, we'll dive deep into several of these modules - JOYSON, CBOR, JSON, MessagePacker, BSON, and the structured clone algorithm. We'll unravel their indispensability in modern web development, particularly in applications like React, where performance and data integrity are paramount.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Data Serialization
&lt;/h2&gt;

&lt;p&gt;Data serialization, the cornerstone of web communication, involves transforming intricate data structures into a storable or transmittable format, only to be accurately reconstructed later. While traditional methods like &lt;code&gt;JSON.stringify&lt;/code&gt; and &lt;code&gt;JSON.parse&lt;/code&gt; are prevalent, they exhibit inherent limitations, especially when grappling with binary data and advanced data types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  JSON and Its Constraints
&lt;/h2&gt;

&lt;p&gt;JSON (JavaScript Object Notation), a text-based format, is celebrated for its simplicity and human readability. But when it comes to binary data, JSON falters, lacking native support for types like &lt;code&gt;Date&lt;/code&gt;, &lt;code&gt;RegExp&lt;/code&gt;, or &lt;code&gt;Buffer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  JOYSON: Elevating JSON
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/vipert/joyson-advanced-data-serialization-in-javascript-4fc"&gt;https://dev.to/vipert/joyson-advanced-data-serialization-in-javascript-4fc&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JOYSON takes JSON a notch higher, offering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Advanced Types and Readability&lt;/strong&gt;: Preserving JSON's legibility, JOYSON introduces support for advanced types. Its ingenious keying system, with prefixes like "##" and "#$", distinguishes values necessitating decoding from those that don't. For instance, &lt;code&gt;"data:joyson/undefined"&lt;/code&gt; uniquely denotes an undefined value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypedArrays and Efficiency&lt;/strong&gt;: JOYSON adopts base64 encoded TypedArrays, enhancing efficiency in handling voluminous datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Cases&lt;/strong&gt;: In scenarios like React applications demanding quick updates and support for types like &lt;code&gt;Date&lt;/code&gt; or &lt;code&gt;RegExp&lt;/code&gt;, JOYSON is a game-changer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CBOR: The Compact Binary Object Representation
&lt;/h2&gt;

&lt;p&gt;CBOR emerges as a binary data serialization format, more succinct than JSON and apt for scenarios demanding efficient data transmission. Its utility shines in IoT devices and server-to-server communication, where bandwidth and processing power are at a premium.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  BSON and MessagePacker
&lt;/h2&gt;

&lt;p&gt;BSON (Binary JSON), primarily employed in MongoDB, is akin to JSON but excels in certain operations like encoding and decoding. MessagePacker, another binary serialization contender, prides itself on its size and speed efficiency, making it ideal for real-time data transmission.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Structured Clone Algorithm
&lt;/h2&gt;

&lt;p&gt;The structured clone algorithm, manifested in modules like &lt;code&gt;structured-clone&lt;/code&gt;, is adept at deep cloning objects, covering complex types beyond JSON's reach. This capability is invaluable for replicating objects with circular references or special types.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  JOYSON vs. CBOR: A Performance and Use Case Analysis
&lt;/h2&gt;

&lt;p&gt;JOYSON and CBOR, while both enhancing JSON, cater to distinct needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JOYSON&lt;/strong&gt;: Strikes a harmony between readability and efficiency. Notably swifter than CBOR in processing large TypedArrays, it removes them from the header during serialization, significantly curtailing processing time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CBOR&lt;/strong&gt;: Perfect for compact data depiction, but JOYSON might surpass it in certain speed-centric scenarios.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Extending the Conversation: Serialization in Modern Web Development
&lt;/h2&gt;

&lt;p&gt;Serialization is more than just a data transmission necessity; it's the backbone of modern web development. As we delve deeper into the realm of complex web applications, the choice of serialization technique becomes crucial. Here's why:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Web applications, particularly those built with frameworks like React, Angular, or Vue, demand brisk state updates and data handling. Efficient serialization directly translates to enhanced user experiences and app performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Integrity&lt;/strong&gt;: In an era where data is king, maintaining its integrity during transmission is non-negotiable. Advanced serialization methods ensure that data, in all its complexity, is accurately transmitted and reconstructed, be it in a Node.js backend or a browser-based frontend.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Implications and Considerations
&lt;/h2&gt;

&lt;p&gt;Developers must judiciously select their serialization tools, factoring in aspects like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Size and Complexity&lt;/strong&gt;: Does the application handle large datasets or complex nested objects? If so, binary serialization formats might be more beneficial.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network Constraints&lt;/strong&gt;: Applications operating under stringent bandwidth conditions might favor compact formats like CBOR or BSON.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Development Ecosystem&lt;/strong&gt;: The choice might also depend on the broader tech stack. For instance, BSON naturally aligns with MongoDB-driven applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Future of Serialization
&lt;/h2&gt;

&lt;p&gt;As we march into the future, the evolution of serialization methods will continue to be driven by emerging technologies and ever-growing data demands. We might witness the advent of even more optimized formats, or perhaps a shift towards entirely new serialization paradigms, influenced by advancements in areas like AI, IoT, and edge computing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Efficiency (100 rounds of processing ~40kB)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Detailed Analysis with Ratings
&lt;/h3&gt;

&lt;h4&gt;
  
  
  BSON
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Loading Speed&lt;/strong&gt;: Very slow, longest time 800ms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rating&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Encoding: 2.0/10&lt;/li&gt;
&lt;li&gt;Decoding: 2.5/10&lt;/li&gt;
&lt;li&gt;Longest: 1.0/10&lt;/li&gt;
&lt;li&gt;Average: 3.0/10&lt;/li&gt;
&lt;li&gt;Shortest: 4.0/10&lt;/li&gt;
&lt;li&gt;Total: 2.5/10&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Joyson
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: Exceptionally fast, longest time 3-4ms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rating&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Encoding: 9.5/10&lt;/li&gt;
&lt;li&gt;Decoding: 9.5/10&lt;/li&gt;
&lt;li&gt;Longest: 9.5/10&lt;/li&gt;
&lt;li&gt;Average: 9.7/10&lt;/li&gt;
&lt;li&gt;Shortest: 9.8/10&lt;/li&gt;
&lt;li&gt;Total: 9.6/10&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Message Packer
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initial Encoding Speed&lt;/strong&gt;: Initially slow but improves.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Balanced Performance&lt;/strong&gt;: Post-initial usage shows good balance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rating&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Encoding: 8.0/10 (initially lower, improves over time)&lt;/li&gt;
&lt;li&gt;Decoding: 8.5/10&lt;/li&gt;
&lt;li&gt;Longest: 8.0/10&lt;/li&gt;
&lt;li&gt;Average: 8.5/10&lt;/li&gt;
&lt;li&gt;Shortest: 9.0/10&lt;/li&gt;
&lt;li&gt;Total: 8.5/10&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;BSON&lt;/strong&gt;: Best for specific ecosystems like MongoDB, but slow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Joyson&lt;/strong&gt;: Top choice for high-speed, efficient data processing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Message Packer&lt;/strong&gt;: Excellent for long-running applications with a balance between encoding and decoding post-initial usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;core-js&lt;/th&gt;
&lt;th&gt;joyson (pack/unpack)&lt;/th&gt;
&lt;th&gt;msgpackr&lt;/th&gt;
&lt;th&gt;cbor-x&lt;/th&gt;
&lt;th&gt;cborg&lt;/th&gt;
&lt;th&gt;bson&lt;/th&gt;
&lt;th&gt;structured-clone&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Average time (ms)&lt;/td&gt;
&lt;td&gt;0.1391&lt;/td&gt;
&lt;td&gt;0.7914&lt;/td&gt;
&lt;td&gt;1.1096&lt;/td&gt;
&lt;td&gt;1.5174&lt;/td&gt;
&lt;td&gt;1.6761&lt;/td&gt;
&lt;td&gt;9.4376&lt;/td&gt;
&lt;td&gt;5.3649&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Longest time (ms)&lt;/td&gt;
&lt;td&gt;4.4&lt;/td&gt;
&lt;td&gt;1.9&lt;/td&gt;
&lt;td&gt;35.8&lt;/td&gt;
&lt;td&gt;44.5&lt;/td&gt;
&lt;td&gt;49.4&lt;/td&gt;
&lt;td&gt;1128.9&lt;/td&gt;
&lt;td&gt;10.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Shortest time (ms)&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;0.6&lt;/td&gt;
&lt;td&gt;0.5&lt;/td&gt;
&lt;td&gt;0.8&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;4.6&lt;/td&gt;
&lt;td&gt;4.7&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Total time (ms)&lt;/td&gt;
&lt;td&gt;139.1&lt;/td&gt;
&lt;td&gt;791.4 (100%)&lt;/td&gt;
&lt;td&gt;1109.6 (140%)&lt;/td&gt;
&lt;td&gt;1517.4 (191%)&lt;/td&gt;
&lt;td&gt;1676.1 (211%)&lt;/td&gt;
&lt;td&gt;9437.6 (1193%)&lt;/td&gt;
&lt;td&gt;5364.9 (678%)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Used size (bytes)&lt;/td&gt;
&lt;td&gt;N/A&lt;/td&gt;
&lt;td&gt;41684&lt;/td&gt;
&lt;td&gt;33983&lt;/td&gt;
&lt;td&gt;29105&lt;/td&gt;
&lt;td&gt;37715&lt;/td&gt;
&lt;td&gt;43431&lt;/td&gt;
&lt;td&gt;43276&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;In the grand scheme of web development, each serialization module - JOYSON, CBOR, BSON, and others - plays a pivotal role, tailored to specific scenarios and needs. JOYSON stands out for balancing JSON's readability with enhanced efficiency and type support. CBOR and BSON excel in compact binary serialization, while the structured clone algorithm shines in deep cloning of complex objects. The art lies in choosing the right tool for the right job, a decision that can profoundly impact the performance and success of web applications.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/joyson"&gt;https://www.npmjs.com/package/joyson&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/cbor-x"&gt;https://www.npmjs.com/package/cbor-x&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/cborg"&gt;https://www.npmjs.com/package/cborg&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/bson"&gt;https://www.npmjs.com/package/bson&lt;/a&gt;, &lt;a href="https://www.npmjs.com/package/msgpackr"&gt;https://www.npmjs.com/package/msgpackr&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>algorithms</category>
      <category>database</category>
      <category>performance</category>
    </item>
    <item>
      <title>JOYSON - Advanced Data Serialization In JavaScript</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Mon, 25 Dec 2023 01:46:54 +0000</pubDate>
      <link>https://forem.com/vipert/joyson-advanced-data-serialization-in-javascript-4fc</link>
      <guid>https://forem.com/vipert/joyson-advanced-data-serialization-in-javascript-4fc</guid>
      <description>&lt;h1&gt;
  
  
  JOYSON: Revolutionizing JSON Serialization with Advanced Data Handling
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4-7XotcU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/logo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4-7XotcU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/logo.png" alt="JOYSON LOGO" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SOURCE: &lt;a href="https://www.npmjs.com/package/joyson"&gt;https://www.npmjs.com/package/joyson&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;JOYSON&lt;/code&gt; is a transformative JavaScript module, redefining the landscape of JSON object encoding and decoding. It's especially proficient with TypedArrays, offering memory-efficient handling of large data structures and binary data serialization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Usage in JavaScript
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Encoding/Decoding an Object
&lt;/h3&gt;

&lt;p&gt;Using &lt;code&gt;JOYSON&lt;/code&gt;, complex objects including those with TypedArrays, regular expressions, and other complex types can be efficiently encoded and decoded. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;##&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;##test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;regex&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="na"&gt;table&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;111111111&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;666.777&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}]),&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="p"&gt;()],&lt;/span&gt; &lt;span class="na"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Int16Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;777&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="na"&gt;arr2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)},&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello here is asaitama I love JS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]};&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JOYSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// `{"test":"hello","data":[1,23,5,6,{"#$IyM=":"data:joyson/undefined;","#$IyN0ZXN0":"data:joyson/regexp;cmVnZXg=:aQ==","##date":"data:joyson/date;2023-12-25T00:33:37.935Z","table":["data:joyson/number;-0","data:joyson/bigint;111111111",-666.777,"data:joyson/set;WzEsMiwiYmx1ZSIse31d","data:joyson/map;W10="],"##arr":"data:joyson/int16array;base64,+v8JAwwA","##arr2":"data:joyson/uint8array;base64,AAAAAAAAAAAA"},"hello here is asaitama I love JS"]}`&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;decoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JOYSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;encoded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;encoded&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;decoded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Packing/Unpacking Data
&lt;/h3&gt;

&lt;p&gt;For efficient binary serialization, &lt;code&gt;JOYSON&lt;/code&gt;'s pack and unpack methods can be used as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;yourObject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Int16Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;777&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="na"&gt;arr2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)}]};&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;packedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JOYSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;yourObject&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Uint8Array of 151 Bytes&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unpackedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JOYSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;unpack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;packedData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;packedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;unpackedData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VDVkKJXP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/pixa-pics/joyson/main/section.png" alt="SECTION" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;JOYSON&lt;/code&gt; represents a significant advancement in the field of data serialization, offering unparalleled efficiency, speed, and versatility. Its development marks a key milestone in addressing the limitations of traditional JSON methods, making it an essential tool for modern web developers. It is yet faster than MessagePacker and CBOR most of the time, also more extensive than those.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>node</category>
    </item>
    <item>
      <title>Rendering Pixel Art (From "Japanese Patterns" to "Emulators" throughout "1980's Classics")</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Mon, 23 Oct 2023 07:39:34 +0000</pubDate>
      <link>https://forem.com/vipert/rendering-pixel-art-from-japanese-patterns-to-emulators-throughout-1980s-classics-1iml</link>
      <guid>https://forem.com/vipert/rendering-pixel-art-from-japanese-patterns-to-emulators-throughout-1980s-classics-1iml</guid>
      <description>&lt;p&gt;&lt;strong&gt;We will visualize multiple grid patterns:&lt;/strong&gt; Squares, Hexagon, Kikko, Omniscale, xBRZ... All that are available in &lt;a href="https://pixa.pics/"&gt;https://pixa.pics/&lt;/a&gt;  (a project of mine to design pixel art)&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When it comes to rendering pixel art, the key is to maintain the artwork's integrity, especially when upscaling or downsampling. The method you use for rendering can heavily affect how the artwork looks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why might it look blurry?
&lt;/h2&gt;

&lt;p&gt;One of the most straightforward methods is the Nearest Neighbor algorithm. It simply takes the nearest pixel's color value and uses that for the new pixel. This results in a crisp-edged look, ideal for preserving hard edges in pixel art. Other algorithms like bilinear or bicubic interpolation take the average of several neighboring pixels. For photos, this can produce smoother transitions, but for pixel art, it results in a blurry look, diluting the distinct hard edges.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tTSmfN_R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qju6t2t61xew8kucrcmc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tTSmfN_R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qju6t2t61xew8kucrcmc.png" alt="Image description" width="730" height="690"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Emulator Upscaling
&lt;/h1&gt;

&lt;p&gt;Modern emulators often upscale older, low-resolution games to make them more visually appealing on current high-resolution displays.&lt;/p&gt;

&lt;h2&gt;
  
  
  xBRZ:
&lt;/h2&gt;

&lt;p&gt;xBRZ (Scale By Rules) is an upscaling filter that enlarges images by an integer factor. It's designed to convert raster graphics into vector graphics, which are then rasterized back at a higher resolution. This makes the upscaled image smoother and free of artifacts, preserving the sharpness of pixel art while improving the visual quality.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qmUE36U3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0w7d8zcg0fvc3283zh4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qmUE36U3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0w7d8zcg0fvc3283zh4.png" alt="Image description" width="438" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  OmniScale:
&lt;/h2&gt;

&lt;p&gt;OmniScale is another modern algorithm. While it's somewhat similar to xBRZ, it uses different techniques to provide even smoother and more detailed upscaling. It focuses on ensuring that edges are crisp and avoids blending unrelated pixels.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vc2eYvWA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrxtds6771otrtitixja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vc2eYvWA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrxtds6771otrtitixja.png" alt="Image description" width="584" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Pixel Upscaled: Square vs. Hexagon vs. Kikko:
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zWRt2Hd7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buqoa4oa6u29bpugc4wa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zWRt2Hd7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buqoa4oa6u29bpugc4wa.png" alt="Image description" width="487" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Square Pixels (Nearest Neighbor):
&lt;/h2&gt;

&lt;p&gt;The traditional way of displaying pixel art is using squares. This is mainly because the vast majority of screens are made up of square pixels. When upscaling using squares, the artwork maintains its original look, and each pixel just becomes a bigger square.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--irCrKUfi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckw0sog4tn5u39d9j0bx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--irCrKUfi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckw0sog4tn5u39d9j0bx.png" alt="Image description" width="800" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hexagonal Pixels:
&lt;/h2&gt;

&lt;p&gt;Upscaling using hexagons offers a different visual aesthetic. It can make the image look more organic due to the six-sided nature of hexagons. However, it's a departure from the traditional pixel art look, and it might not always be faithful to the original design.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_WjL6Bsn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho633prhagmorlz6ek36.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_WjL6Bsn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ho633prhagmorlz6ek36.png" alt="Image description" width="800" height="756"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bishamon Kikko Pattern:
&lt;/h2&gt;

&lt;p&gt;Kikko is a traditional Japanese pattern based on hexagons. The word "Kikko" refers to the shell of a tortoise, and the hexagonal pattern is reminiscent of its shape. In Japanese culture, the tortoise is a symbol of longevity, and hence this pattern is often associated with wishes for a long life.&lt;/p&gt;

&lt;p&gt;In the context of pixel art, if one were to upscale using a Kikko pattern, it would be a fusion of traditional Japanese aesthetics with digital art. It would be a unique look, different from traditional pixel art, but could be visually appealing in its own right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xARXDqlj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n53ig2z61uotmxmv5kp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xARXDqlj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n53ig2z61uotmxmv5kp5.png" alt="Image description" width="800" height="825"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;*Click on the image to zoom in ;)&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion:
&lt;/h1&gt;

&lt;p&gt;The choice of rendering and upscaling method for pixel art boils down to the aesthetic you're aiming for. Nearest Neighbor and modern algorithms like xBRZ and OmniScale ensure crisp edges and an improved visual quality. However, choosing to upscale with different shapes like hexagons or patterns like Kikko introduces a unique visual flair, bridging the old with the new.&lt;/p&gt;

</description>
      <category>design</category>
      <category>coding</category>
      <category>testing</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Cracking JS Hexagons 🔍🤔</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Fri, 20 Oct 2023 17:59:26 +0000</pubDate>
      <link>https://forem.com/vipert/cracking-js-hexagons-fle</link>
      <guid>https://forem.com/vipert/cracking-js-hexagons-fle</guid>
      <description>&lt;p&gt;&lt;strong&gt;Author&lt;/strong&gt;: Affolter Matias&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yr2Saocy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vvnwih4tols96ov8rnz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yr2Saocy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7vvnwih4tols96ov8rnz.png" alt="Image description" width="800" height="753"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever wondered how to turn a simple image into a mesmerizing hexagon masterpiece? No? Well, we're going to show you anyway! Our hero for today is a JavaScript function that can generate stunning hexagonal patterns from regular images. 🎨✨&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hexagon Enigma 🤯❓
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;generateFinalBase64&lt;/code&gt; function is our main magician. It takes an &lt;code&gt;originalImageData&lt;/code&gt; and a radius as parameters. But wait, what's the deal with that radius value? Why must it be between 2 and 36? Well, good question! It turns out that we can't just make hexagons of any size; there are limits to the magic. 🪄&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Invalid radius value. Must within 2 and 36." - The Magic Barrier 🧙‍♂️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Now, let's dive into the incantations of this function:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;a&lt;/code&gt;, &lt;code&gt;r&lt;/code&gt;, and &lt;code&gt;d&lt;/code&gt; are constants that we need for hexagon math. Why? Because hexagons are all about angles (radians) radius and diameter! 📐📏&lt;/p&gt;

&lt;p&gt;We create a canvas and set its width and height. But the calculations for the canvas dimensions are like deciphering an ancient hexagonal script. What's with that &lt;code&gt;Math.sin(a)&lt;/code&gt; and &lt;code&gt;Math.cos(a)&lt;/code&gt; stuff? &lt;strong&gt;It's all part of the hexagon secret code. 🔍🔢&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;==&amp;gt; &lt;a href="https://eperezcosano.github.io/hex-grid/"&gt;Hexagon secret code "explained"&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's a function called &lt;code&gt;getUint32&lt;/code&gt;. It takes some data and an index and returns a magical 32-bit integer. Ever wondered how colors are represented in the digital realm? It's all about these bits of wizardry! 🧙‍♂️🌈&lt;/p&gt;

&lt;p&gt;And then, there's &lt;code&gt;uint32ToHex&lt;/code&gt;. It turns those magical 32-bit integers into colorful HTML hex codes. It's like turning lead into gold, but much more colorful! 🌟🌈&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;getColor&lt;/code&gt; gets the color of a pixel from our image data and makes it look pretty. Who doesn't love a beautiful hexagon in their favorite color? 🎨😍&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;drawHexagon&lt;/code&gt; does what its name says - it draws hexagons with style. We even give them a stroke and a fill. Who knew hexagons had such fashion sense? 👗👠&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;drawGrid&lt;/code&gt; is the mastermind behind the big picture. It takes care of arranging hexagons in a grid, complete with zigzags! It's like a symphony of hexagons dancing on a canvas. 🎶💃&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, we bring everything together, paint it on a canvas, and return our hexagon masterpiece in all its glory. It's like making a delicious hexagonal cake and serving it to the world. 🍰🌍&lt;/p&gt;

&lt;h2&gt;
  
  
  The Grand Finale 🌟✨
&lt;/h2&gt;

&lt;p&gt;But that's not the end of our adventure! There's one more function called &lt;code&gt;hexagonrender&lt;/code&gt;. It takes an &lt;code&gt;image_data&lt;/code&gt;, a scale, and something called pool. And it returns a promise! What's the promise, you ask? The promise of a scaled-up image data. It's like a magician pulling a rabbit out of a hat! 🐇🎩&lt;/p&gt;

&lt;p&gt;And that, my friends, is how you unlock the secrets of the hexagon code. Go forth, create hexagonal wonders, and remember, every great piece of art starts with a little bit of magic! ✨🎨&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Used in &lt;a href="https://pixa.pics/"&gt;https://pixa.pics/&lt;/a&gt;&lt;/strong&gt; where you can draw pixel art.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* MIT License, Copyright (c) 2023 Affolter Matias */&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;generateFinalBase64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;radius&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;radius&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Invalid radius value. Must within 2 and 36&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Create constant&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;radius&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Create an intermediate canvas to draw hexagon onto it&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Hexagons are taking 1x Diameter less 1/2 radius of width&lt;/span&gt;
    &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&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="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Hexagons are taking a height that is computed differently&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getUint32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Verify the given index is within the bounds of the r, g, b, a uint8array&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// "Sum up" 4 x 8bits into 1 x 32 bit unsigned integer&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;24&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="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;16&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="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;uint32ToHex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;uint32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Converting the number to a hexadecimal string which is added to a string made of zeroes&lt;/span&gt;
        &lt;span class="c1"&gt;// The hexadecimal with padding is cut to represent a fixed length of rrggbbaa which are added to "#"&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;00000000&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;uint32&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&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="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;getColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;w&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;w&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Compute the index (within the data where 4 elements gives a color&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;uint32ToHex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getUint32&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;drawHexagon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Define the style of painting on our canvas context&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lineWidth&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;strokeStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;color&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;beginPath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="c1"&gt;// Draw all intersections in a new path&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lineTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="c1"&gt;// Close the path and fill the area&lt;/span&gt;
        &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;closePath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;drawGrid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sizeX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sizeY&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;posX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;posY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// When we return to a new line, if we have an odd number of column&lt;/span&gt;
        &lt;span class="c1"&gt;// We end up going to the bottom from a higher y coordinate (ZIGZAG in Y)&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;RorD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sizeX&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Must go once or twice to the bottom&lt;/span&gt;

        &lt;span class="c1"&gt;// As long as we have column to then change y coordinate to the new lower line&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;posY&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;sizeY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;RorD&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;posX&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Reset cursor x&lt;/span&gt;
                &lt;span class="nx"&gt;posX&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;sizeX&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// As long as we still have some column in line&lt;/span&gt;
                &lt;span class="c1"&gt;// Do the zigzag magic between hexagon of a line&lt;/span&gt;
                    &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)),&lt;/span&gt;
                    &lt;span class="nx"&gt;y&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// Get the hexadecimal HTML5 color and draw the shape&lt;/span&gt;
                &lt;span class="nx"&gt;drawHexagon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;getColor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;sizeX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;posX&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;posY&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
                &lt;span class="nx"&gt;posX&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Update current coordinate X&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;posY&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Update current coordinate Y&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Paint our new image into our working canvas&lt;/span&gt;
    &lt;span class="nx"&gt;drawGrid&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Paint the working canvas into a new one with a ratio that is not distorted&lt;/span&gt;
    &lt;span class="c1"&gt;// Since hexagon are placed asymmetrically in columns and lines, we have to flatten the height a bit&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;canvas2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// The width doesn't change&lt;/span&gt;
    &lt;span class="c1"&gt;// Yet we apply the same mathematical operation of the one used for the width yet for the height&lt;/span&gt;
    &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;originalImageData&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ctx2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Draw the image with a correct ratio&lt;/span&gt;
    &lt;span class="nx"&gt;ctx2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;drawImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Return the new image data&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;ctx2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getImageData&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;canvas2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// This function return a promise that return the up scaled image data&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;hexagonrender&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;image_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;scale&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;pool&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;generateFinalBase64&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;image_data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;scale&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="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;hexagonrender&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;hexagonrender&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VMsn32ZV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40wgrtzwwakue0glk9o2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VMsn32ZV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/40wgrtzwwakue0glk9o2.png" alt="Image description" width="800" height="1255"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>TIPS ON: The Garbage Collector Myth: A Reflection on Web App Memory Efficiency and Corporate Structure (2/2)</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Mon, 02 Oct 2023 16:26:17 +0000</pubDate>
      <link>https://forem.com/vipert/tips-on-the-garbage-collector-myth-a-reflection-on-web-app-memory-efficiency-and-corporate-structure-22-16h3</link>
      <guid>https://forem.com/vipert/tips-on-the-garbage-collector-myth-a-reflection-on-web-app-memory-efficiency-and-corporate-structure-22-16h3</guid>
      <description>&lt;p&gt;BASED ON THIS THEOREM: &lt;a href="https://dev.to/vipert/the-garbage-collector-myth-a-reflection-on-web-app-memory-efficiency-and-corporate-structure-3ho6"&gt;https://dev.to/vipert/the-garbage-collector-myth-a-reflection-on-web-app-memory-efficiency-and-corporate-structure-3ho6&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;MEANT TO EXPLAIN THAT: "The inefficiencies in our code often mirror the inefficiencies in our teams."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;HERE IS: &lt;strong&gt;Navigating the Web of Memory: Practical Steps and Mistakes to Avoid&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the vast landscape of web development, navigating the intricacies of memory management becomes as essential as following the north star on a dark, clouded night. The beauty of web applications lies not just in their functionalities, but in the efficiency and precision with which they are sculpted. And, often, this requires breaking old patterns to create new, more streamlined pathways.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"&lt;em&gt;Fresh winds that break, also create&lt;/em&gt;."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Theorem: The Art of Object Reuse and Efficient Memory Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Crafting a web application is much like molding a piece of art. While creating something from scratch is often applauded, reusing elements without compromising on quality or integrity is an art in itself. Understanding and leveraging this practice holds the key to efficient memory usage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Techniques in Practice:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reusing Objects:&lt;/strong&gt; Instead of continuously spawning new objects, consider maintaining a pool. When an object is no longer needed, it's returned to the pool rather than being discarded, ready to be repurposed. This minimizes the overhead of frequent allocations and garbage collections.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;TypedArray and Sub Arrays:&lt;/strong&gt; The use of TypedArrays can be a boon for performance. By sometimes employing a sub-array and avoiding the slice method, unnecessary copying is mitigated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Internal Temporary Variables:&lt;/strong&gt; While placing temporary variables inside an object's class might not directly impact memory, it can have implications for cleaner and more efficient code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfalls:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Drawing from real-world examples, platforms such as Instagram provide us with valuable lessons. Despite using advanced concepts like immutability, it's suspected they falter by creating 'blobs' without invoking "revokeObjectUrl" or even BitmapImages without the necessary "destroy" function. Such oversights can severely hinder the garbage collector, making it oblivious to unnecessary BitmapImages and object URLs.&lt;/p&gt;

&lt;p&gt;Another glaring example is SoundCloud on desktop. Hours-long listening sessions cause accumulating audio files in the JS HEAP, which are only removed upon a session end or forced tab refresh. Solutions? The practice of destroying media content when it's no longer in view, or even utilizing tools like indexedDB for storage, ensuring swift retrievals without taxing network bandwidth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mindset for Modern Developers:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's essential to recognize that negative comments or distractions won't shape the trajectory of our coding journey. Mastery in any discipline requires dedication, focus, and continuous learning. And this is especially true for web development. To this end, allocating time, perhaps even a day each week, for exploring others' codes, diving into insightful articles, and remaining updated with evolving browser and JavaScript nuances becomes imperative.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
As we harness the winds of change, breaking certain patterns and creating more efficient ones, the horizon of web application development shines brighter. By mastering the art of memory management and avoiding common pitfalls, we can craft experiences that are both delightful for the user and efficient in execution.&lt;/p&gt;

&lt;p&gt;So, as we navigate the seas of the web, let's steer our ships with knowledge, practice, and unwavering focus. 🌟&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Probable Web Memory Hiccups of Giants: A Closer Look&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When we delve deeper into the mechanics of popular platforms like Instagram and SoundCloud on the web, a recurrent issue surfaces: memory management.&lt;/p&gt;

&lt;p&gt;It is suspected that these platforms create "blob" objects, a raw data representation often used for tasks like file operations, without accompanying them with the necessary "revokeObjectUrl" method. The &lt;code&gt;revokeObjectUrl&lt;/code&gt; method releases any existing object URLs which were previously generated by the &lt;code&gt;createObjectURL&lt;/code&gt; method, thus aiding in memory management.&lt;/p&gt;

&lt;p&gt;Furthermore, they might be using &lt;code&gt;BitmapImage&lt;/code&gt; objects without invoking the vital "destroy" function. Such an oversight can have profound implications for the overall memory usage of an application.&lt;/p&gt;

&lt;p&gt;Here's why these two points are of particular concern:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Garbage Collector's Blind Spot:&lt;/strong&gt; The garbage collector is a robust tool, but it's not omniscient. It doesn't frequently check for obsolete bitmap images and object URLs. More often than not, during a typical browsing session, these overlooked objects remain untouched. This, over time, accumulates and could lead to inefficient memory usage, degrading the user's experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Untouched Memory Reserves:&lt;/strong&gt; When "blobs" and &lt;code&gt;BitmapImage&lt;/code&gt; objects are left without their respective cleanup calls, they remain as untouched memory reserves. This means that even if they are no longer serving any purpose or function within the application, they continue to consume precious memory resources. Such residues can cause notable lags and glitches, especially in prolonged user sessions.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This points us to an imperative lesson: while giants in the tech world pave the way with innovation, even they aren't immune to overlook certain aspects. As developers and tech enthusiasts, recognizing and rectifying such memory pitfalls becomes our collective responsibility. After all, the devil, as they say, is in the details.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Imperative of Personal Development for Web Developers in Large Organizations
&lt;/h2&gt;

&lt;p&gt;In the dynamic realm of web development, where technologies evolve at a rapid pace, continuous learning becomes more than just a value-added skill—it becomes a necessity. For developers working in large corporations, this principle of constant personal and professional growth holds even more weight. One might ask why? Here's a perspective that not only answers this but also offers a way forward.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Personal Projects and Blogs Matter:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enhancing Skill Sets:&lt;/strong&gt; Personal projects allow developers to experiment with new technologies, design paradigms, or methodologies that might not be part of their day-to-day work but could provide invaluable insights or skills.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Building a Portfolio:&lt;/strong&gt; A developer's personal projects or blog can serve as a testament to their passion, commitment, and expertise in the field. It showcases their proactive approach to learning and adapting.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Community Building:&lt;/strong&gt; By sharing knowledge through blogs or online platforms, developers contribute to the growth of the community. It's a two-way street—the community benefits from the shared expertise, and the developer gains feedback, alternative viewpoints, and potential collaboration opportunities.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;A Proposed Approach for Large Corporations:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Given the significance of personal development, large organizations should adopt a two-pronged approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dedicated Off-Code Day:&lt;/strong&gt; Allocate a dedicated day or half-day during the workweek, still compensated, for developers to focus solely on personal projects, research, or knowledge enhancement. This would not only aid in their personal growth but would also bring fresh perspectives and innovative solutions to the organization.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A Benchmark for Productivity:&lt;/strong&gt; While productivity should never be solely gauged by one's side projects or blogs, a consistent commitment to these can indicate a developer's passion and drive. A developer who cannot set aside time for personal research, projects, or sharing knowledge might need to reconsider their position in a rapidly evolving industry.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;In Conclusion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the vast landscape of web development, standing still is equivalent to moving backward. Personal projects, blogs, and continuous learning are not just extracurriculars—they are essential tools for ensuring relevance, growth, and productivity. Corporations that recognize this and invest in their developers' personal growth will find themselves at the forefront of innovation and industry leadership. After all, growth and learning are iterative, and there's always another milestone on the horizon. 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The Garbage Collector Myth: A Reflection on Web App Memory Efficiency and Corporate Structure</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Sat, 30 Sep 2023 14:44:05 +0000</pubDate>
      <link>https://forem.com/vipert/the-garbage-collector-myth-a-reflection-on-web-app-memory-efficiency-and-corporate-structure-3ho6</link>
      <guid>https://forem.com/vipert/the-garbage-collector-myth-a-reflection-on-web-app-memory-efficiency-and-corporate-structure-3ho6</guid>
      <description>&lt;p&gt;In the intricate realm of web applications, memory efficiency often hides behind the mask of the garbage collector. While this automated janitor is heralded for its ability to clean up unused memory, its efficacy is frequently overestimated. The difference between the perceived efficiency and the real-world scenario can be exemplified by the Garbage Collector Myth.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The inefficiencies in our code often mirror the inefficiencies in our teams." &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Theorem&lt;/strong&gt;: &lt;em&gt;The Garbage Collector Myth&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;Given a web application, the percentage reduction in memory usage after invoking the garbage collector (typically seen during a memory snapshot) mirrors the percentage of non-contributing or under-performing employees in large corporations, particularly those behind such applications.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  &lt;strong&gt;Evidence&lt;/strong&gt;:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Discrepancy in Memory Use&lt;/strong&gt;: When examining the memory footprint of a running web application in a JavaScript engine versus the size after a memory snapshot (which calls the garbage collector), a stark difference is often observed. This snapshot can, at times, show a reduction of up to 400% or more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Examples in Practice&lt;/strong&gt;: Notable platforms like Instagram and various other large-scale web services demonstrate properties indicative of non-optimized memory utilization. Often, these applications, much like bloated corporations, contain "dirty" logical instructions that are far from clean, elegant, or RAM-friendly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Inefficiencies in Code vs. Inefficiencies in Corporations&lt;/strong&gt;: The amount of unused JavaScript objects in the HEAP, which the garbage collector deems non-essential, can be seen as a metaphor for non-contributing employees in a corporate setting. Just as the garbage collector identifies and removes unused objects to optimize the application, corporations often recognize and (unfortunately) have to address under performing employees for optimal productivity.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Discussion&lt;/strong&gt;:
&lt;/h2&gt;

&lt;p&gt;The inability of developers to programmatically call the garbage collector and rely on its clean-up is reminiscent of the larger bureaucratic structures where manual interventions are challenging. As a result, developers, like managers, must think differently and optimize at the source.&lt;/p&gt;

&lt;p&gt;The Garbage Collector Myth speaks to a greater irony. Web applications, which are developed by teams within corporations, reflect the inefficiencies inherent in those very corporations. The non-essential objects cluttering the HEAP are analogous to employees whose roles have become obsolete or redundant in the fast-evolving corporate world.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;:
&lt;/h2&gt;

&lt;p&gt;This theorem, while humorous in its parallelism, underscores two critical messages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Web Application Development&lt;/strong&gt;: Developers must be vigilant and proactive in optimizing memory usage from the onset, rather than relying solely on garbage collectors. This will result in cleaner, faster, and more efficient applications that provide enhanced user experiences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Corporate Structure&lt;/strong&gt;: Modern corporations, especially tech giants, should constantly evaluate and optimize their structures, ensuring that every team member contributes positively to the organization's overarching goals.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In essence, both the world of web development and corporate structures could benefit from regular introspection, efficient design, and proactive optimization. 😊&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>productivity</category>
    </item>
    <item>
      <title>BitArray &amp; SetFixed (JS) are awesome for compression or drawing | 250 K Booleans =&gt; 31 kB</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Sat, 30 Sep 2023 13:51:16 +0000</pubDate>
      <link>https://forem.com/vipert/bitarray-setfixed-js-are-awesome-for-compression-or-drawing-250-k-booleans-31-kb-lg7</link>
      <guid>https://forem.com/vipert/bitarray-setfixed-js-are-awesome-for-compression-or-drawing-250-k-booleans-31-kb-lg7</guid>
      <description>&lt;h2&gt;
  
  
  Boolean Array (~ 11.3 kB &amp;amp; 0 dep.)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Introducing the Ultimate JavaScript Module for Memory-Efficient Boolean Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🚀 &lt;strong&gt;Optimized Efficiency&lt;/strong&gt;: Leveraging the power of this module, you can ensure unparalleled memory efficiency, especially in applications requiring operations that most other solutions simply can't match. With other systems, you could easily find yourself using up to ten times more system resources. With our solution, you can kiss those inefficiencies goodbye.&lt;/p&gt;

&lt;p&gt;🔍 &lt;strong&gt;Real-world Applications&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Data Compression&lt;/strong&gt;: When you're compressing data and need to keep track of repeated patterns, our module excels. Register whether patterns are stored in a table swiftly and efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drawing Apps&lt;/strong&gt;: For those seeking rapid pixel selection in drawing applications, this module is your go-to. Process pixel selections at lightning speed!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;💾 &lt;strong&gt;Memory Footprint&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A staggering 1/4 million entries take up a mere 31kB in memory.&lt;/li&gt;
&lt;li&gt;Engaging with ten 2D pixel selections of 500x500? That's a featherlight 0.3mB for the entire lot.&lt;/li&gt;
&lt;li&gt;Store up to eight thousand boolean values in just 1kB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔐 &lt;strong&gt;Precision Limitations&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Designed for a singular purpose: handling boolean values.&lt;/li&gt;
&lt;li&gt;Functions within a fixed index size limited to positive whole numbers.&lt;/li&gt;
&lt;li&gt;Doesn't try to be everything; it just excels at what it's meant to do.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🛠️ &lt;strong&gt;Design Efficiency&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Methods and properties are memory-efficient, with intentional design ensuring that the module remains within its internal state. Only the properties and methods with public "getters" extend beyond.&lt;/li&gt;
&lt;li&gt;Low-level operations are precisely tuned for the JavaScript engine, ensuring minimal computation force. We've rigged numbers to avoid bulky double storage, streamlining memory usage further.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🖋️ &lt;strong&gt;Bottom Line&lt;/strong&gt;: If you're into data compression or drawing applications, this kind of solution is almost indispensable. With its precise focus and memory efficiency, it's time to elevate your operations to the next level with our module.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The source code has many comments as well and the library is very flexible, there is many ways to harness its potential with different ways to use it in your code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/@asaitama/boolean-array"&gt;https://www.npmjs.com/package/@asaitama/boolean-array&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;The SmartRunLengthCompress and SmartRunLengthDecompress functions utilize the SetFixed and BitArray data structures to implement a highly efficient form of run-length encoding. By using a 1-bit matchmaking system, SetFixed in conjunction with BitArray facilitates compression that's almost 8 times more space-efficient for non-repeating values, while only consuming an eighth more space for multiple repetitions. This enables the compression of image data, particularly suitable for pixel art with similar colors, into a much more compact form. The design leverages the concept of a "lazy" run-length algorithm, where lengths are not always mandatory, and values without specific lengths are set to false (0) in the bitarray. Thus, it provides a unique and optimized approach to data compression, which balances space savings with the ability to handle both repeating and non-repeating values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;SmartRunLengthCompress&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;lengths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;lengths_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;values_constructor_bits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data_uintX&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nb"&gt;Uint32Array&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data_uintX&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nb"&gt;Uint16Array&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="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;values_constructor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values_constructor_bits&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Uint32Array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;values_constructor_bits&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Uint16Array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;values_constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;values_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;values_using_compression&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;SetFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;latest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;repeated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;

        &lt;span class="nx"&gt;latest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data_uintX&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;latest&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mh"&gt;0xFF&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt; &lt;span class="c1"&gt;// The value is new or surpass chunk length&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
                &lt;span class="c1"&gt;// We set the index of the current value to hold a length&lt;/span&gt;
                &lt;span class="nx"&gt;values_using_compression&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="c1"&gt;// We add the number of repetition inside the lengths array&lt;/span&gt;
                &lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;lengths_l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
                &lt;span class="nx"&gt;lengths_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lengths_l&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="c1"&gt;// We add the value inside the values array&lt;/span&gt;
                &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;values_l&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="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;values_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values_l&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="c1"&gt;// We add the value inside the values array&lt;/span&gt;
                &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;values_l&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="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;values_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values_l&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="nx"&gt;repeated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;current&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;latest&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// The value is repeated&lt;/span&gt;
            &lt;span class="nx"&gt;repeated&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="c1"&gt;// We set the index of the current value to hold a length&lt;/span&gt;
        &lt;span class="nx"&gt;values_using_compression&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="c1"&gt;// We add the number of repetition inside the lengths array&lt;/span&gt;
        &lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;lengths_l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;repeated&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="nx"&gt;lengths_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lengths_l&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// We add the value inside the values array&lt;/span&gt;
        &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;values_l&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="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;values_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values_l&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// We add the value inside the values array&lt;/span&gt;
        &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;values_l&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="nx"&gt;current&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;values_l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values_l&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;bits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;values_constructor_bits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;lengths_l&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;values&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;values_l&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;matchmaking&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;values_using_compression&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uint32array&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;SmartRunLengthDecompress&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="kd"&gt;constructor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bits&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Uint32Array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bits&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nb"&gt;Uint16Array&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;lengths&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;matchmaking&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;SetFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;BitArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matchmaking&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;total_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// values that aren't alone&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nx"&gt;total_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;total_length&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// values that are repeated&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kd"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;total_length&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;total_length&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);){&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;matchmaking&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)){&lt;/span&gt;
            &lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;lengths&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;output&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
            &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;output&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;



</description>
      <category>javascript</category>
      <category>opensource</category>
      <category>node</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>A New Horizon in Data Compression: Matchmaking Run-Length Algorithm</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Fri, 25 Aug 2023 04:57:00 +0000</pubDate>
      <link>https://forem.com/vipert/a-new-horizon-in-data-compression-matchmaking-run-length-algorithm-26gi</link>
      <guid>https://forem.com/vipert/a-new-horizon-in-data-compression-matchmaking-run-length-algorithm-26gi</guid>
      <description>&lt;p&gt;In the realm of data compression, efficiency is a sought-after virtue. The world may seem consumed by the rush towards innovation, but true progress lies in the nuanced methods that reshape our reality. Enter the "matchmaking" run-length algorithm, an inventive approach to data compression.&lt;/p&gt;

&lt;h1&gt;
  
  
  Introducing the Algorithm
&lt;/h1&gt;

&lt;p&gt;The "matchmaking" run-length algorithm uses a boolean array based on a typed array to understand if a value in process requires to consume a length in the Uint8Array of lengths.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why It Matters
&lt;/h1&gt;

&lt;p&gt;In the landscape of data where run length is efficient, we often encounter values that don't repeat themselves. Using an entire byte (which is 8 bits) to specify that the value is only used once can be an extravagance.&lt;/p&gt;

&lt;p&gt;# How It Works&lt;br&gt;
Here's where our method turns conventional wisdom on its head.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Lengths Table:&lt;/strong&gt; This is a record of the lengths of continuous sequences of a given value.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Values Table:&lt;/strong&gt; It will include values that are repeated (and therefore have lengths) and those that are "alone" or not repeated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Boolean Array (Uint1Array):&lt;/strong&gt; A novel addition, this acts as a switch that tells us when to consume a length and when to simply put the value once.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  The Efficient Dance
&lt;/h1&gt;

&lt;p&gt;The algorithm functions on typed arrays, and the mechanism can be understood as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If a value repeats, the boolean array instructs to fetch the corresponding length from the lengths table.&lt;/li&gt;
&lt;li&gt;If a value doesn't repeat (it is "alone"), the boolean array instructs to use the value itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach avoids consuming an entire byte to represent a single occurrence, an epitome of Affolter Matias's commitment to innovative elegance.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Results
&lt;/h1&gt;

&lt;p&gt;What we witness here is a prime example of the beauty and complexity of compression algorithms. This method can drastically reduce the memory footprint, driving forward our ceaseless quest for understanding and elevation in the technological arena.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The "matchmaking" run-length algorithm, with its unique utilization of boolean arrays and typed arrays, leads us to a promising threshold of data compression efficiency. Its fusion of simplicity and brilliance resonates with the resonant urge for technological excellence, showcasing that the pursuit of greatness involves rejecting the ordinary and striving for the extraordinary.&lt;/p&gt;

&lt;p&gt;In action: &lt;a href="https://www.npmjs.com/package/@asaitama/boolean-array"&gt;https://www.npmjs.com/package/@asaitama/boolean-array&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Real-world application
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NLLmV7WG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycedu9vgvmml64mcn9ik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NLLmV7WG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ycedu9vgvmml64mcn9ik.png" alt="Image description" width="800" height="614"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Typed Arrays for Pixel Art Color Indexing
&lt;/h2&gt;

&lt;p&gt;In the realm of pixel art, color indexing plays a pivotal role in compressing the data, and this is where typed arrays come into play. Depending on the number of unique colors, different typed arrays can be used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uint8Array: Suitable for images with fewer than 256 unique colors. By using 8 bits to store a color reference, it becomes an efficient way to represent the color data.&lt;/li&gt;
&lt;li&gt;Uint16Array or Bigger: For more complex images with a wider color palette, larger typed arrays like Uint16Array can be employed. These store references to the colors in 16 bits or more, allowing for a broader range of unique colors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Storing color as a reference rather than a whole Uint32 color (which includes red, green, blue, and alpha channels) leads to a much lighter footprint. This alone provides a significant reduction in data size, yet the compression could be further optimized.&lt;/p&gt;

&lt;h2&gt;
  
  
  Matchmaking Run Length Algorithms for Improved Compression
&lt;/h2&gt;

&lt;p&gt;The continuity of the same color indexes in pixel art was a factor that seemed inefficient and somewhat irksome. Despite the space-saving achieved through the use of Uint8Array or Uint16Array, there remained a need for a more succinct expression of continuous same-colored pixels. This led to the exploration of a novel solution.&lt;/p&gt;

&lt;p&gt;By utilizing a matchmaking run length algorithm alongside a bit array (rather than a byte array), it became possible to reconcile the issue of "lonely patterns" that would have otherwise interfered with compression. This approach leverages two components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Matchmaking Table: A table that links the lengths and values, managing the relationship between the repeated values and the number of times they occur.&lt;/li&gt;
&lt;li&gt;Uint1Array: This specialized array informs the algorithm when to consume a length and when to represent a unique value, making the representation incredibly efficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The implementation of this matchmaking run length algorithm provided a &lt;strong&gt;performance boost (storage) that was 2.2 times lighter&lt;/strong&gt;. It optimized the representation without sacrificing any detail or quality, proving to be a remarkably effective technique for compressing pixel art color indexes.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>5 Important Tips to Master Pixel Art within the Next Minute</title>
      <dc:creator>ViperT</dc:creator>
      <pubDate>Thu, 06 Jul 2023 21:22:22 +0000</pubDate>
      <link>https://forem.com/vipert/5-important-tips-to-master-pixel-art-within-the-next-minute-1dbm</link>
      <guid>https://forem.com/vipert/5-important-tips-to-master-pixel-art-within-the-next-minute-1dbm</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;Pixel art has captivated gamers and artists alike with its unique charm and retro aesthetic. Whether you're a seasoned pixel artist or just starting your journey, mastering the art form can be both challenging and rewarding. With the right tools and techniques, you can create stunning pixel art in no time. In this article, we will explore five essential tips that will allow you to elevate your pixel art skills instantly. And to assist you on this creative journey, we'll showcase the incredible pixel art editor, &lt;a href="https://pixa.pics/"&gt;pixa.pics&lt;/a&gt;, which simplifies the process and enhances your pixel art experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  1) Start with a Concept:
&lt;/h2&gt;

&lt;p&gt;Before diving into pixel art, it's crucial to have a clear concept in mind. Planning your artwork beforehand will help you focus on the details and overall composition. Consider the subject, style, and color palette you want to use. This initial step will allow you to create pixel art with a purpose and deliver a more impactful result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZCgOc7ML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jt4a1y6x57e2l3y9l84.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZCgOc7ML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7jt4a1y6x57e2l3y9l84.png" alt="Image description" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2) Choose the Right Pixel Art Editor:
&lt;/h2&gt;

&lt;p&gt;An efficient pixel art editor can significantly enhance your workflow and productivity. Enter pixa.pics, a powerful tool designed to make pixel art creation accessible to all skill levels. Its user-friendly interface, robust feature set, and intuitive controls enable artists to bring their ideas to life effortlessly. With pixa.pics, you can easily create, edit, and animate pixel art, making it an ideal choice for both beginners and professionals.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lQLWjXts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/24pistoc9j8dahvuiirr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lQLWjXts--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/24pistoc9j8dahvuiirr.png" alt="Image description" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3) Master the Pixel Grid:
&lt;/h2&gt;

&lt;p&gt;Pixel art relies on precise placement of pixels to create intricate designs. Understanding the pixel grid and utilizing it effectively is essential. Each pixel represents a single point of color, so working within a limited canvas size requires attention to detail. Pixa.pics offers a grid overlay and zooming options, enabling you to work with precision and create pixel-perfect art effortlessly.&lt;/p&gt;

&lt;h2&gt;
  
  
  4) Experiment with Color Palettes:
&lt;/h2&gt;

&lt;p&gt;Choosing the right color palette is crucial in pixel art. Limited color choices can add depth and character to your artwork. Pixa.pics provides a color palette editor that allows you to create, save, and apply custom color schemes seamlessly. Experiment with different palettes to find the perfect combination that suits your artistic vision.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_r6C_lZE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7phedrc64cjnj90t2ss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_r6C_lZE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7phedrc64cjnj90t2ss.png" alt="Image description" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5) Embrace Iterative Improvement:
&lt;/h2&gt;

&lt;p&gt;Pixel art is a meticulous process that benefits from iterative improvement. Don't be discouraged if your initial attempts fall short of your expectations. Embrace the learning process, experiment with techniques, and learn from your mistakes. Pixa.pics offers layer support, allowing you to refine and revise individual elements without affecting the entire composition. This feature enables you to iterate and polish your artwork, resulting in pixel-perfect masterpieces.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Pixel art is a delightful medium that allows artists to blend creativity and nostalgia into captivating visuals. With the right tips and tools, you can master the art of pixel art in no time. By starting with a concept, choosing the right pixel art editor like pixa.pics, understanding the pixel grid, experimenting with color palettes, and embracing iterative improvement, you'll be well on your way to creating stunning pixel art.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So why wait? Dive into the world of pixel art today with &lt;a href="https://pixa.pics/"&gt;pixa.pics&lt;/a&gt;, and let your imagination run wild!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k98FdPOJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8v92n80ildlvqlsrnmkz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k98FdPOJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8v92n80ildlvqlsrnmkz.png" alt="Image description" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
