
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@xtia/pipe2d-image
Advanced tools
Read and write images with the power of Pipe2D
Inspired by graphics shaders, Pipe2D provides a simple unified addressing interface for a transforming pipeline to any 2-dimensional concept.
The refraction logic can be summarised as:
import { renderRGBAPipe, createImagePipe } from "@xtia/pipe2d-image";
const refractionStrength = 10;
const refractionImage = await createImagePipe("cursor-refraction-map.png");
// read red and green channels as displacement offsets
const refractionPipe = refractionImage.map(rgba => [
((rgba.red / 255) - .5) * refractionStrength,
((rgba.green / 255) - .5) * refractionStrength,
]); // Pipe2D<[x, y]>
function renderCursorBackground(cursorX: number, cursorY: number) {
// create a pipe to read background from refracted coordinates
const cursorPipe = backgroundPipe.mapCoordinates((x, y) => {
const [refractX, refractY] = refractionPipe.get(x, y);
return [x + refractX, y + refractY];
}).crop(cursorX, cursorY, cursorCanvas.width, cursorCanvas.height);
// draw it on a canvas
renderRGBAPipe(cursorCanvas);
}
createImagePipe(source, options?): Pipe2D<RGBA> creates a pipe that samples an image (HTMLCanvasElement | HTMLImageElement | OffscreenCanvas | ImageData | Pipe2D<RGBA> or 2D rendering context)async createImagePipe(url, options?): Pipe2D<RGBA> loads an image from a URL and creates a a pipe that samples itrenderRGBAPipe(target[, x, y[, dw, dh]]) renders a RGBAPipe to a canvas/canvas context/imageData.renderRGBAPipe(): OffscreenCanvas renders a RGBAPipe to and returns a new OffscreenCanvas of the pipe's dimensions.renderRGBAPipe()'s target may be an HTMLImageElement, in which case the update may not occur synchronously (image elements always load asynchronously), so renderRGBAPipe() will return a Promise, resolved when the image is loaded.
FAQs
Leverage Pipe2D to read, transform and render images
We found that @xtia/pipe2d-image 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.