Merge pull request #38 from nagadomi/set_compression_level
set compression level of the output file
This commit is contained in:
commit
4221c19839
|
@ -26,11 +26,11 @@ function image_loader.encode_png(rgb, alpha)
|
|||
rgba[4]:copy(alpha)
|
||||
local im = gm.Image():fromTensor(rgba, "RGBA", "DHW")
|
||||
im:format("png")
|
||||
return im:toBlob()
|
||||
return im:toBlob(92) -- I don't know why is 92 best compression ratio.
|
||||
else
|
||||
local im = gm.Image(rgb, "RGB", "DHW")
|
||||
im:format("png")
|
||||
return im:toBlob()
|
||||
return im:toBlob(92)
|
||||
end
|
||||
end
|
||||
function image_loader.save_png(filename, rgb, alpha)
|
||||
|
|
Loading…
Reference in a new issue