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

base64-image-utils

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base64-image-utils - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

6

package.json
{
"name": "base64-image-utils",
"version": "1.1.2",
"version": "1.1.3",
"description": "Utils for base64 image data.",

@@ -14,4 +14,4 @@ "main": "index.js",

"keywords": ["base64", "image", "imagedata", "base64image"],
"author": "hi@javier.xyz",
"license": "ISC",
"author": "Javier Bórquez <hi@javier.xyz> (http://github.com/javierbyte)",
"license": "MIT",
"bugs": {

@@ -18,0 +18,0 @@ "url": "https://github.com/javierbyte/base64-image-utils/issues"

@@ -5,5 +5,4 @@ # base64 image utils

# Installation
```
npm i base64-image-utils --save
npm i base64-image-utils
```

@@ -13,16 +12,32 @@

```js
var base64ImageUtils = require('base64-image-utils')
const base64ImageUtils = require('base64-image-utils')
var {base64ImageToRGBMatrix, base64ImageToRGBArray, base64ImageToImageData} = base64ImageUtils
const {base64ImageToRGBMatrix, base64ImageToRGBArray, base64ImageToImageData} = base64ImageUtils
base64ImageToImageData(imgSrc, function(err, rawData, img) {
base64ImageToImageData(imgSrc, function(err, rawData, img) {
})
})
base64ImageToRGBMatrix(imgSrc, function(err, data) {
/*
data is a matrix with rows and columns that corresponds
to every pixel of the image, where each pixel is represented
as:
{
base64ImageToRGBMatrix(imgSrc, function(err, data) {
/*
data is a matrix with rows and columns that corresponds
to every pixel of the image, where each pixel is represented
as:
{
r: <Red value of the color>,
g: <Green value of the color>,
b: <Blue value of the color>,
a: <Alpha value of the color>
}
*/
})
base64ImageToRGBArray(imgSrc, function(err, data) {
/*
data is an array with every pixel described as:
as:
{
x: <X position of the pixel>,
y: <Y position of the pixel>,
rgb: {
r: <Red value of the color>,

@@ -33,23 +48,7 @@ g: <Green value of the color>,

}
*/
})
base64ImageToRGBArray(imgSrc, function(err, data) {
/*
data is an array with every pixel described as:
as:
{
x: <X position of the pixel>,
y: <Y position of the pixel>,
rgb: {
r: <Red value of the color>,
g: <Green value of the color>,
b: <Blue value of the color>,
a: <Alpha value of the color>
}
}
*/
})
}
*/
})
```
You can optionally send a third `options` parameter, which is an object that can hold `width` or `maxWidth` values.
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