ws-tex: image/icns (read RLE / ARGB / 1-bit / PNG-hook entries, JP2 skipped; write PNG via encodeImage or RLE)

Tested against libicns (png2icns / icns2png -x), Pillow's writer and a hand-written file.
This commit is contained in:
4DBug committed 2026-10-31 15:07:07 -05:00
1 parent ce4845ae13
commit 9e114fba8b
6 files changed
+519

No files matched your search

+12
View File
@@ -156,3 +156,15 @@ if Fmt then
end
end
end
if which == "icns" then
-- square icons 16 / 32 / 48 / 128 as RLE entries (no encodeImage hook here)
local Icns = require("@formats/image/icns")
local base = image(128, 128, "rgba8", 1)
base.frames = {}
for i, s in { 16, 32, 48, 128 } do
base.frames[i] = { image = image(s, s, "rgba8", i), delay = 0, x = 0, y = 0, dispose = "none", blend = "source" }
end
base.pixels = base.frames[4].image.pixels
emit("ours_legacy.icns", Icns.encode(base))
end