Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
archaic
Advanced tools
Readme
Reproduce images from geometric primitives (Node.js + browser port of primitive), forked from transitive-bullshit/primitive.
npm install --save archaic
# or
yarn add archaic
# or
bun install archaic
Archaic is usable from both Node.js and browser environments. Most of the API options between the two are the same, with minor differences in input and output configurations.
Available shape types:
A target image is provided as input. The algorithm tries to find the single most optimal shape that can be drawn to minimize the error between the target image and the drawn image. It repeats this process, adding one shape at a time. Around 50 to 200 shapes are needed to reach a result that is recognizable yet artistic and abstract.
This GIF demonstrates the iterative nature of the algorithm, attempting to minimize the mean squared error by adding one shape at a time (use a ".gif" output file to generate one yourself).
Reproduces the given input image using geometric primitives.
Returns a Promise for the generated model.
Available output formats:
Type: function (opts): Promise
opts
Object Configuration options
opts.input
string Input image to process (can be a local path, http url, or data url)opts.output
string? Path to generate output imageopts.numSteps
number Number of steps to process [1, 1000] (optional, default 200
)opts.minEnergy
number? Minimum energy to stop processing early [0, 1]opts.shapeAlpha
number Alpha opacity of shapes [0, 255] (optional, default 128
)opts.shapeType
string Type of shapes to use (optional, default traingle
)opts.numCandidates
number Number of top-level candidates per step [1, 32] (optional, default 1
)opts.numCandidateShapes
number Number of random candidate shapes per step [10, 1000] (optional, default 50
)opts.numCandidateMutations
number Number of candidate mutations per step [10, 500] (optional, default 100
)opts.numCandidateExtras
number Number of extra candidate shapes per step [0, 16] (optional, default 0
)opts.onStep
function? Optional async function taking in the model and step indexopts.log
function Optional logging function (console.log to enable logging) (optional, default noop
)Reproduces the given input image using geometric primitives.
Optionally draws the results to an HTML canvas.
Returns a Promise for the generated model.
Type: function (opts): Promise
opts
Object Configuration options
opts.input
(string | Image | ImageData) URL, Image, or ImageData of input image to processopts.output
(string | HTMLCanvasElement)? Selector or DOM Element of HTMLCanvas to draw resultsopts.numSteps
number Number of steps to process [1, 1000] (optional, default 200
)opts.minEnergy
number? Minimum energy to stop processing early [0, 1]opts.shapeAlpha
number Alpha opacity of shapes [0, 255] (optional, default 128
)opts.shapeType
string Type of shapes to use (optional, default traingle
)opts.numCandidates
number Number of top-level candidates per step [1, 32] (optional, default 1
)opts.numCandidateShapes
number Number of random candidate shapes per step [10, 1000] (optional, default 50
)opts.numCandidateMutations
number Number of candidate mutations per step [10, 500] (optional, default 100
)opts.numCandidateExtras
number Number of extra candidate shapes per step [0, 16] (optional, default 0
)opts.onStep
function? Optional async function taking in the model and step indexopts.log
function Optional logging function (console.log to enable logging) (optional, default noop
)There are several other ports of the primitive algorithm, including at least two JavaScript ports that I'm aware of. This module isn't necessarily better; I created it out of pure fascination.
MIT © Giorgio Garasto
Original project by Travis Fischer.
FAQs
Reproduce images from geometric primitives.
The npm package archaic receives a total of 9 weekly downloads. As such, archaic popularity was classified as not popular.
We found that archaic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.