We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function reverseImage(image) { const canvas = document.createElement('canvas') const {width, height} = image Object.assign(canvas, {width, height}) const context= canvas.getContext('2d') context.drawImage(image, 0, 0) const {data} = context.getImageData(0, 0, width, height) const imageData = new ImageData( new Uint8ClampedArray( Array.from(data).map(x => 255 - x).reverse() ), height, width ) Object.assign(canvas,{width: height, height: width}) context.putImageData(imageData, 0, 0) return canvas } function simpleImageEncode(imageUrl) { return new Promsie(resolve => { const image = new Image() image.src = imageUrl image.onload = () => { resolve(reverseImage(image)) } }) }
Update: not safe, alpha value postion can't change, will lost color, should only switch postion of rgb value
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Update: not safe, alpha value postion can't change, will lost color, should only switch postion of rgb value
The text was updated successfully, but these errors were encountered: