Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@loaders.gl/images

Package Overview
Dependencies
Maintainers
10
Versions
328
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/images

Framework-independent loaders and writers for images (PNG, JPG, ...)

  • 1.3.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
297K
decreased by-1.45%
Maintainers
10
Weekly downloads
 
Created

What is @loaders.gl/images?

@loaders.gl/images is a part of the loaders.gl suite, designed to handle image loading and processing. It provides utilities for loading, parsing, and manipulating image data in various formats.

What are @loaders.gl/images's main functionalities?

Loading Images

This feature allows you to load images from a URL or file. The `load` function from `@loaders.gl/core` is used in conjunction with `ImageLoader` from `@loaders.gl/images` to fetch and parse the image.

const { load } = require('@loaders.gl/core');
const { ImageLoader } = require('@loaders.gl/images');

async function loadImage(url) {
  const image = await load(url, ImageLoader);
  console.log(image);
}

loadImage('https://example.com/image.png');

Parsing Image Data

This feature allows you to parse raw image data from an ArrayBuffer. The `parse` function from `@loaders.gl/core` is used with `ImageLoader` to interpret the image data.

const { parse } = require('@loaders.gl/core');
const { ImageLoader } = require('@loaders.gl/images');

async function parseImageData(arrayBuffer) {
  const image = await parse(arrayBuffer, ImageLoader);
  console.log(image);
}

// Assuming arrayBuffer contains image data
parseImageData(arrayBuffer);

Image Manipulation

This feature allows you to manipulate image data after loading it. The `getImageData` function extracts image data that can be further processed or manipulated.

const { load } = require('@loaders.gl/core');
const { ImageLoader, getImageData } = require('@loaders.gl/images');

async function manipulateImage(url) {
  const image = await load(url, ImageLoader);
  const imageData = getImageData(image);
  console.log(imageData);
}

manipulateImage('https://example.com/image.png');

Other packages similar to @loaders.gl/images

Keywords

FAQs

Package last updated on 12 Mar 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc