![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
canvasshop
Advanced tools
Readme
Tools to manipulate html canvas images
applyDifferenceImageUsingMap
Use a map to selectively replace pixels in an original image with those from a difference image. All three images are expected to be the exact same size.
originalImage
- The image get pixels from wherever the mapImage
doesn't match mapColor
differenceImage
- The image to get pixels from wherever the mapImage
does match mapColor
mapImage
- The image that indicates where to use the original or the difference imagemapColor
- pixels in mapImage
that match this color use imageData from differenceImage
concatenateImagesIntoGridImage
Combine several images with equal dimensions, passed in as an array of array of images or canvases, into one large image. This function is the inverse of separateGridImageIntoArray
.
imagesArray
- A two-dimensional array of equally sized images, where the first index indicates the row that the image will appear in and the second index indicates the column. For example, the image in imagesArray[2][1]
will appear in the thrid row from the top, in th second column from the left.convertDifferenceImageToSolidColorMap
Convert a difference image created using getImageWithOlyChangedPixels
to a solid color map that can be used by applyDifferenceImageUsingMap
.
differenceImage
- The difference image to convert into a solid color map.mapColor
- The solid color to use on the map image.generateShadingImageFromLightingComponents
Combine a diffuse-lighting-only image and a specular-lighting-only image to create a semi-transparent shading image that can be overlayed on a flat color image to give the appearance of depth.
diffuseImage
- The image with only diffuse lighting. The rendered object should have a base color with green = 255, as that's the channel that's looked at to generate the shading image.specularImage
- The image with only specular lighting. The specular reflections should usually be white, but they must at least have red = 255, as that's the channel that's looked at to generate the lighting image.getImageWithOnlyChangedPixels
Compare two images and return an image that is transparent except for those pixels that are different between the two images being compared.
originalImage
- The first image to compare.changedImage
- The second image to compare. The non-transparent pixels of the resulting image will match the pixels of this image.replaceRGBChannelsWithColors
Replace the red, green and blue channels of a given image with a weighted blend of three other colors.
image
- The image in which to replace the RGB channelsredReplacement
- An array of three values, e.g., [255, 0, 255], representing the RGB values of the color that is to replace the red channel.greenReplacement
- The same thing, but the color to replace green with.blueReplacement
- The same thing, but the color to replace blue with.separateGridImageIntoArray
Separate one large image into an array of smaller, eqally sized images. This function is the inverse of concatenateImagesIntoGridImage
.
compositeImage
- The image to split into multiple imagesxCount
- The number of columns to split the composite image intoyCount
- The number of rows to split the composite image intoFAQs
Tools to manipulate html canvas images
The npm package canvasshop receives a total of 0 weekly downloads. As such, canvasshop popularity was classified as not popular.
We found that canvasshop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.