Projets
Voir sur GitHub
image-js/fast-png
À propos
Décodeur et encodeur d’images PNG entièrement écrits en JavaScript
Design et médiasProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- 0
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalMaintained by Zakodium
fast-png
PNG image decoder and encoder written entirely in JavaScript.
Installation
npm install fast-png
API
Complete API documentation
decode(png[, options])
Arguments
png- A TypedArray or Buffer that contains the PNG data.options- An object of options
Options
checkCrc- If set totrue, the CRC will be checked for each chunk and an error will be thrown in case it's wrong (default: false).
encode(image)
Arguments
png- An object representing the image. You can pass an ImageData from the Canvas API or an object with the following properties:width- The width of the imageheight- The height of the imagedata- An array or TypedArray with the image datadepth- A number indicating the color depth (only 8 and 16 are supported now). Default:8.channels- Number of channels, including alpha (1, 2, 3 and 4 are supported). Default:4.text- An object with key-value pairs representingtEXtchunks. The keys must have less than 80 characters. The keys and values must have only characters in the latin1 charset (maximum code point of 255). Default:undefined.
hasPngSignature(array)
Returns whether the array starts with the PNG signature (magic bytes).
PNG standard
Spec can be found at: https://www.w3.org/TR/PNG/
License
Explorer des projets similaires
Chargement…