Changes
- Export COLORTERM=truecolor on windows platform (+WSLENV).
- Fix DECRQM.
- Fix sixel transparency: #917 (comment)
I decided to slightly complicate the wrapping of Sixel images in AnyPlex. I decided to kill two birds with one stone: quality and the lack of alpha transparency support in JPEGs.
Hybrid Image Encoding: PNG vs. JPEG+Mask
The primary goal of this separation is to optimize the balance between asset file size and visual fidelity across different image types and scales. The choice of encoding method changes at the 4096-pixel threshold based on the following technical motivations:
1. Why Smaller Assets ($\leq 4096$) Use Pure PNG
- Lossless Precision: Small assets like system icons, UI corners, and vector-style decorations rely heavily on crisp, pixel-perfect boundaries.
- Artifact Prevention: Compressing small UI elements with JPEG (even at $Q=80$) introduces high-frequency visual noise ("ringing artifacts") around sharp edges.
- Encoding Efficiency: At smaller dimensions, the file size overhead of PNG is negligible, making the preservation of flawless alpha transparency and sharp details the highest priority.
2. Why Larger Assets ($> 4096$) Use JPEG + Alpha Mask
- Exponential Compression Gains: For photographic content or large complex graphics, standard PNG file sizes scale poorly. JPEG drastically reduces file sizes by discarding visually redundant high-frequency data.
- Separation of Concerns: Standard JPEG does not support transparency. Combining a lossy RGB JPEG with a separate 8-bit alpha mask allows for transparency while keeping the combined file size significantly smaller than a single lossless PNG.
- Noise Filtering: At the 4096 boundary, the $Q=80$ JPEG compression artifacts start to degrade the clarity of fine details. Setting the filter threshold precisely at 4096 ensures that lossy artifacts are confined to assets where they do not compromise vital UI crispness.
Statistical Context
- Input Range Analyzed: Asset dimensions spanning from micro-UI elements up to large-scale background graphics.
- Artifact Noise Floor: Quantization noise from $Q=80$ compression dominates the spectrum below the 4096 mark, rendering JPEG unsuitable for smaller, crisp UI components.
- Target Retention: High-contrast UI elements strictly reside in the $\leq 4096$ pure PNG zone, while large-scale assets benefit from the $> 4096$ hybrid JPEG+Mask compression.