1.0.0-alpha.6 • Published 3 years ago

@alt1/imagedata-loader v1.0.0-alpha.6

Weekly downloads
76
License
-
Repository
-
Last release
3 years ago

Alt1 ImageData Loader

This loader loads png images as ImageBuffer objects to use their raw pixels. Using this loader will fix several pitfalls with the png specification. In particular it removes the sRGB header to prevent discoloration of the raw pixels. This loader returns a Promise which resolves to an ImageData object.

Installation

npm i @alt1/font-loader -s

Usage

//webpack.config.json

module.exports={
	...
	module: {
		rules: [
			...
			{
				test: /\.data.png$/,
				loader: ['@alt1/imagedata-loader']
			}
		]
	}
}
//app.js

//required for ImageData.prototype.show and also used by the client sided part of the loader
import "@alt1/base";

require("./img.png").then(buffer=>{
	buffer.show();
})
1.0.0-alpha.6

3 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha.0

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

6 years ago