-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Closed
Closed
Copy link
Description
It looks like Image:drawImage() behaves like BlendMode.SRC instead of BlendMode.NORMAL in indexed image.
This example works:
local a = Image(2, 2, ColorMode.INDEXED)
local b = Image(2, 2, ColorMode.INDEXED)
a:putPixel(0, 0, 0) a:putPixel(1, 0, 1)
a:putPixel(0, 1, 2) a:putPixel(1, 1, 3)
b:drawImage(a)
b:drawImage(a, 1, 0)
assert(b:getPixel(0, 0) == 0) assert(b:getPixel(1, 0) == 0)
assert(b:getPixel(0, 1) == 2) assert(b:getPixel(1, 1) == 2)But it should be:
local a = Image(2, 2, ColorMode.INDEXED)
local b = Image(2, 2, ColorMode.INDEXED)
a:putPixel(0, 0, 0) a:putPixel(1, 0, 1)
a:putPixel(0, 1, 2) a:putPixel(1, 1, 3)
b:drawImage(a)
b:drawImage(a, 1, 0)
assert(b:getPixel(0, 0) == 0) assert(b:getPixel(1, 0) == 1) -- This pixel shouldn't be overwritten
-- because 0 in src=a is mask color
assert(b:getPixel(0, 1) == 2) assert(b:getPixel(1, 1) == 2)Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done