jimp-dev/jimp

Bug? Blend mode "SCREEN" does not work on transparent pixels

開放

#1,019 建立於 2021年6月5日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (785 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (13,218 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Expected Behavior

I create a new Jimp with all pixels set to 0xFFFFFF00, then composite another image with all pixels set to 0x00000000 over it using Jimp.BLEND_SCREEN, then set the result to opaque, like so:

var pic = new Jimp(25, 25, 0xFFFFFF00).composite(new Jimp(25, 25, 0x00000000), 0, 0, {mode:Jimp.BLEND_SCREEN}).opaque();

This should yield an image with all pixels at 0xFFFFFFFF.

Current Behavior

The result is an image with everything set to 0x000000FF;

Failure Information (for bugs)

It looks like the algorithm simply nulls everything when the destination is at alpha 0? This makes it impossible, for example, to composite a blurred version of a picture that has transparency over itself using screen blending in order to create a halo of light - it will look like a drop shadow instead!

This also happens with ADD, by the way.

Steps to Reproduce

See above for code.

Context

  • Jimp Version: 0.16.1 in a browser
  • Operating System: win
  • Node version: n/a

貢獻者指南