Coder Social home page Coder Social logo

lefelys / randomface Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 1017 KB

Vector faces generator focused on uniqueness

Home Page: https://randomface.lefelys.com

License: MIT License

JavaScript 2.07% CSS 1.32% TypeScript 96.61%
avatar avatar-generator javascript random-avatars random-face react svg

randomface's Introduction

Randomface

Randomface is JS/React package for generating vector face-like figures from SHA-256 hash.

About

Why?

Although various random face/avatar generators have existed for a long time, none of them provide genuine randomness in face generation. Many rely on pre-defined images of facial features combined with repetitive patterns, which diminishes the uniqueness and individuality of generated faces.

Randomface takes a different approach by keeping only the positions of facial features fixed while randomizing everything else. This results in a vast range of simple abstract facial expressions, making each face unique and easily distinguishable even in large groups.

And it is lightweight - it doesn't have any external dependencies and outputs a plain SVG. The only requirement is a SHA-256 hash for a face input, which should not be a problem to obtain on any modern platform.

How it works?

  1. Randomface expects a SHA-256 hash on input (hashing algorithm is not included in the package).

  2. The hash in decimal form is split into pairs of two-digit numbers, representing coordinates:

    10298733624955409702... => [10, 29], [87, 33], [62, 49], [55, 40], [97, 2]...
    
  3. 100x100 square is divided into four sectors to accommodate various facial features:

  4. Pairs of two-digit numbers are plotted on the square, sorted and connected in each sector:

How to use it?

Refer to JS/TS and React packages documentation

Where to use it?

Besides obvious use case of a generating random avatars, randomface was actually created as a variation of Chernoff face implementation for everyday uses.

Our brains are exceptionally proficient in recognizing faces, yet the same aptitude does not apply when it comes to processing textual data. Verifying checksums, cryptographic keys, passwords, cryptocurrency addresses, UUIDs, bank accounts, etc., through visual inspection is cognitively demanding and prone to errors.

By giving the data a face, we can leverage the innate and effective process of facial recognition (enchanced with emotion detection) to handle visual verification tasks.

A real world example where Chernoff face can be useful - visual verification of payment details:

Entering a bank account number manually for a money transfer can be both stressful and error-prone, particularly when dealing with payment details received via post or within copy-protected PDFs. A simple typographical error could lead to funds being mistakenly transferred to an incorrect account.

By incorporating a visual reference, such as a Chernoff face, we can ensure the accuracy of entered data by cross-referencing it with the automatically generated information in the payment form. This additional layer of verification enhances the reliability of the transfer process and minimizes the risk of errors.

       

randomface's People

Contributors

lefelys avatar

Stargazers

Marat Bektimirov avatar  avatar Gustavo Bini avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.