Pictures with compressed quality < 100 (JPEG variant of format 4)
Header byte 1 = quality; data type 0 = baseline JPEG of the picture padded with black to multiples of 16 and then rotated for the display direction (libjpeg/Pillow, 4:2:0, 96 dpi), byte-identical to the Editor for opaque pictures (18/18); alpha runs cover the padded picture. add_picture(quality=), CLI add-picture -q, MCP add_picture quality; decoder in to_image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
55c2f9d6b6
commit
c102157ac2
8 files changed
+152
-23
No files matched your search
+1
-2
@@ -13,7 +13,7 @@ byte for byte, or a file written by nxhmi was opened in the Editor and showed th
|
||||
| Checksums (page, project header, file table) | **complete**, verified |
|
||||
| Components | **31 / 31 types** (20 Basic + 11 Intelligent-only) read/write/create |
|
||||
| Readable JSON (enum names, colours) | done for every value list the Editor documents |
|
||||
| Pictures | **complete**: format 0 (Basic) and format 4 (Intelligent, with alpha), all display directions |
|
||||
| Pictures | **complete**: format 0 (Basic) and format 4 (Intelligent, with alpha; run-length or JPEG for quality < 100), all display directions |
|
||||
| Fonts | **complete** for single-byte encodings: black/white and the anti-aliasing flag, overhanging glyphs, all display directions |
|
||||
| Rendering pages like the Editor | **pixel-identical** for every Basic component and 9 of 11 Intelligent-only ones; ComboBox and Switch approximate at anti-aliased edges |
|
||||
| New projects from scratch | `project.new_project(model)` for 12 Basic/Intelligent models; the generated demo is byte-identical to the Editor's re-save |
|
||||
@@ -93,7 +93,6 @@ byte for byte, or a file written by nxhmi was opened in the Editor and showed th
|
||||
### `.HMI` side
|
||||
| Item | Notes |
|
||||
|---|---|
|
||||
| Picture quality below 100 (Editor picture list "Q:") | not studied |
|
||||
| Multi-byte encodings (GB2312, Big5, ...) | only single-byte fonts studied |
|
||||
| Other display series | Discovery / Enhanced / Edge not sampled; only Basic + Intelligent templates |
|
||||
| Display direction | byte 12 decoded and written (`new_project(portrait=...)`); picture order verified for all four (format 4); font glyph order for 90° only |
|
||||
|
||||
+11
-1
@@ -235,7 +235,17 @@ four directions, with and without alpha):
|
||||
- Pictures of 1-2 pixels stay format 0 (seen: 1x1, 2x1, 1x2; 8x1 is converted); nxhmi does the
|
||||
same. The Editor shows a message box per picture while converting format-0 pictures it finds
|
||||
in an Intelligent project.
|
||||
- **OPEN**: the "Q:100" quality shown in the Editor's picture list -- only quality 100 studied.
|
||||
- Compressed quality (picture list right-click > "Compressed quality setting", 1-99; shown as
|
||||
"Q:nn"): header byte 1 = quality (100 = 0x64 for the run-length variant). Data: u32 **0**
|
||||
(JPEG), u32 width and height padded up to multiples of 16, u32 0, u32 0, then a baseline JPEG
|
||||
of the padded picture (black padding at the right/bottom, *then* rotated into stored order),
|
||||
4:2:0, 96 dpi JFIF -- byte-identical to libjpeg (Pillow) at that quality for opaque pictures
|
||||
(18/18 samples: qualities 1/30/50/99, landscape and portrait). Then, if the picture has alpha,
|
||||
the same alpha run section, covering the *padded* picture (padding alpha 0), at the offset in
|
||||
header +20. With alpha the Editor first passes the colours through premultiplied alpha; nxhmi
|
||||
approximates that step (JPEG a few levels off in some pixels; alpha section identical). The
|
||||
simulator decodes the JPEG like libjpeg (opaque pictures render pixel-exact); transparent ones
|
||||
blend within 1 level.
|
||||
|
||||
Adding a picture = `N.is` + `N.i` + a `i`/`N.i` resource-list entry (kept grouped with the other
|
||||
`i` entries) -- verified in the Editor.
|
||||
|
||||
Reference in new issue
Block a user