
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
skeleton-tracing-wasm
Advanced tools
A new algorithm for retrieving topological skeleton as a set of polylines from binary images: WASM version
<script src="https://cdn.jsdelivr.net/npm/skeleton-tracing-wasm/build/trace_skeleton_wasm.js"></script>
const TraceSkeleton = require('skeleton-tracing-wasm')
import TraceSkeleton from 'skeleton-tracing-wasm'
You first need to initiate/load the wasm module calling a static method load()
const tracer = await TraceSkeleton.load()
then you can use the API methods
const { polylines,rects } = tracer.fromCanvas(HTMLCANVAS)
Or instead of async/await you can do
TraceSkeleton.load().then(tracer => {
// wasm module loaded
// here is your code
const { polylines,rects } = tracer.fromCanvas(HTMLCANVAS)
})
The below API's take an image representation and returns an object holding the polylines as well as rects processed by the algorithm (the latter is mainly for visualization)
{
"polylines": [[[x,y],[x,y]],[[x,y],[x,y],[x,y],...],...],
"rects": [[x,y,w,h],[x,y,w,h],...]
}
TraceSkeleton.fromCanvas(canv)
Takes in an HTML Canvas object and returns the skeleton as polyilnes as well as the rects.
TraceSkeleton.fromImageData(imgData)
Takes JavaScript ImageData object (e.g. document.createElement("canvas").getContext('2d').getImageData(0,0,100,100)
)
TraceSkeleton.fromBoolArray(arr,w,h)
Takes array of booleans (or truthy and falsy values), e.g. [0,1,0,1,1,1,0,0,...]
or [0,255,255,0,...]
or [true,false,true,false,...]
or even [undefined, "ok", null, "yes", ...]
TraceSkeleton.fromCharString(str,w,h)
Takes in a (char*)
such as "\0\1\0\0\1\1\0...."
. This is the fastest (though probably most obscure) API because it does not need to translate the input to C constructs.
TraceSkeleton.visualize(result, {scale, strokeWidth, rects, keypoints})
Conveniently visualize the result from the previous functions, returns a string holding an SVG (scalable vector graphics).
Options:
scale
: factor to scale the drawingrects
: draw the rects?keypoints
: draw the keypoints on the polylines?strokeWidth
: weight of the polyline strokes.See /index.html
for more detailed usage example, with animation, interactivity, webcam, etc.
https://skeleton-tracing.netlify.app/
Developed at Frank-Ratchye STUDIO for Creative Inquiry at Carnegie Mellon University.
FAQs
A new algorithm for retrieving topological skeleton as a set of polylines from binary images: WASM version
We found that skeleton-tracing-wasm demonstrated a not healthy version release cadence and project activity because the last version was released 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.