diff --git a/packages/core/src/composite/index.js b/packages/core/src/composite/index.js index ef47622a8..f48c964ba 100644 --- a/packages/core/src/composite/index.js +++ b/packages/core/src/composite/index.js @@ -68,6 +68,12 @@ export default function composite(src, x, y, options = {}, cb) { y + sy, constants.EDGE_CROP ); + + if (dstIdx === -1) { + // Skip target pixels outside of dst + return; + } + const blended = blendmode( { r: this.bitmap.data[idx + 0] / 255, diff --git a/packages/jimp/test/images/cops-composited.jpg b/packages/jimp/test/images/cops-composited.jpg index 5a5264895..2df93c3ca 100644 Binary files a/packages/jimp/test/images/cops-composited.jpg and b/packages/jimp/test/images/cops-composited.jpg differ