jimp-dev / jimp-dev/jimp

Support Uint8ClampedArray

Open
#912 2 comments 14 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
14.7k
Forks
777
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I want to be able to load and save images using a [Uint8ClampedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray). Such array stores the red, green, blue and alpha of each pixel in the image from left to right, then top to bottom. This is similar to how `image.bitmap.data` works.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

Support passing a Uint8ClampedArray to `Jimp.create` and add `image.getUint8ClampedArray()`.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

[Manually parsing them](https://github.com/Richienb/render-gif/blob/f881b8adeb5d85f0f72169f764a9b837b6327393/index.js#L22-L29), adding each pixel one at a time to the image.

**Additional context**
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.