mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
PNG: Remove unnecessary flooring
This commit is contained in:
parent
8e42d027a0
commit
f5526205cb
@ -371,7 +371,7 @@ end
|
|||||||
end
|
end
|
||||||
for index, value in pairs(png.data) do
|
for index, value in pairs(png.data) do
|
||||||
if color == "grayscale" then
|
if color == "grayscale" then
|
||||||
local a, Y = rescale_depth(floor(value / (2^depth)), depth, 8), rescale_depth(floor(value % (2^depth)), depth, 8)
|
local a, Y = rescale_depth(floor(value / (2^depth)), depth, 8), rescale_depth(value % (2^depth), depth, 8)
|
||||||
png.data[index] = a * 0x1000000 + Y * 0x10000 + Y * 0x100 + Y -- R = G = B = Y
|
png.data[index] = a * 0x1000000 + Y * 0x10000 + Y * 0x100 + Y -- R = G = B = Y
|
||||||
else
|
else
|
||||||
assert(color == "truecolor" and depth == 16)
|
assert(color == "truecolor" and depth == 16)
|
||||||
|
Loading…
Reference in New Issue
Block a user