Intelligent pictures (format 4) and direction-aware picture order
Format 4 decoded from Editor output: control words of eight 4-bit ops (runs up to 13, 12-bit long runs, literal blocks) over 8 colour slots, plus a run-length 7-bit alpha section. The encoder reproduces all 28 Editor samples byte for byte and the Editor keeps our pictures as is. Pictures are stored rotated by the display direction, byte 0 of N.i is 0x0A + direction; this applies to format 0 too. add_picture now writes the right format and order for the project; the renderer decodes format 4 and blends alpha. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a93cb58b96
commit
193bcd5d97
8 files changed
+301
-56
No files matched your search
+4
-1
@@ -185,7 +185,10 @@ class Renderer:
|
||||
w = min(w, src.width - sx)
|
||||
h = min(h, src.height - sy)
|
||||
if w > 0 and h > 0:
|
||||
img.paste(src.crop((sx, sy, sx + w, sy + h)), (dx, dy))
|
||||
part = src.crop((sx, sy, sx + w, sy + h))
|
||||
# Intelligent pictures can carry alpha: blended over what is below (blend not yet
|
||||
# compared with the Editor pixel by pixel)
|
||||
img.paste(part, (dx, dy), part if part.mode == "RGBA" else None)
|
||||
|
||||
def _box(self, c):
|
||||
x, y, w, h = c.get("x"), c.get("y"), c.get("w"), c.get("h")
|
||||
|
||||
Reference in new issue
Block a user