How to use the pngjs.PNG.bitblt function in pngjs

To help you get started, we’ve selected a few pngjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / pngjs / pngjs-tests.ts View on Github external
// closed
});
png.on('foo', () => {});

png.pack().adjustGamma();

png.parse('foo').adjustGamma();
png.parse(Buffer.from('foo')).adjustGamma();
png.parse('foo', (error, data) => {
    error.stack;
    data.adjustGamma();
}).adjustGamma();

PNG.adjustGamma(png);

PNG.bitblt(png, pngs[1]);
PNG.bitblt(png, pngs[1], 1, 1, 1, 1, 1, 1);
github americanexpress / jest-image-snapshot / src / diff-snapshot.js View on Github external
composerParams.images.forEach((image, index) => {
        PNG.bitblt(
          image.imageData, compositeResultImage, 0, 0, image.imageWidth, image.imageHeight,
          composerParams.offsetX * index, composerParams.offsetY * index
        );
      });
      // Set filter type to Paeth to avoid expensive auto scanline filter detection
github DefinitelyTyped / DefinitelyTyped / types / pngjs / pngjs-tests.ts View on Github external
});
png.on('foo', () => {});

png.pack().adjustGamma();

png.parse('foo').adjustGamma();
png.parse(Buffer.from('foo')).adjustGamma();
png.parse('foo', (error, data) => {
    error.stack;
    data.adjustGamma();
}).adjustGamma();

PNG.adjustGamma(png);

PNG.bitblt(png, pngs[1]);
PNG.bitblt(png, pngs[1], 1, 1, 1, 1, 1, 1);
github meinaart / cypress-plugin-snapshots / src / utils / tasks / imageSnapshots.js View on Github external
function createCompareCanvas(width, height, source) {
  const canvas = new PNG({
    width,
    height,
    colorType: 6,
    bgColor: {
      red: 0,
      green: 0,
      blue: 0,
      alpha: 0,
    }
  });
  PNG.bitblt(source, canvas, 0, 0, source.width, source.height, 0, 0);
  return canvas;
}
github TradeMe / tractor / packages / tractor-plugin-visual-regression / src / tractor / server / image-areas / image-areas.js View on Github external
function cropImage (png, areaData) {
    let { minX, minY, maxX, maxY } = areaData;
    let width = maxX - minX;
    let height = maxY - minY;
    let cropped = new PNG({ width, height });
    PNG.bitblt(png, cropped, minX, minY, width, height, 0, 0);
    return cropped;
}
github americanexpress / jest-image-snapshot / src / diff-snapshot.js View on Github external
const createImageResizer = (width, height) => (source) => {
  const resized = new PNG({ width, height, fill: true });
  PNG.bitblt(source, resized, 0, 0, source.width, source.height, 0, 0);
  return resized;
};

pngjs

PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis