mirror of
https://github.com/storytold/figcraft.git
synced 2026-12-04 19:41:51 -05:00
be04080442
The decoded-image cache held 256 copies whatever their size, fewer than one page of such a file shows, so a render dropped copies it needed again. Image adjustments ran per pixel at full size after every decode, and a copy at a new size, or a shadow's opacity check, decoded the image again. - The cache holds up to 4096 copies within its unchanged 512 MB budget. - Adjustments are looked up in a table of the colours an image has met (the same results). - A canvas copy at a smaller size is averaged down from a larger cached copy; exports reuse only the full decode, so their pixels are unchanged. - An image's opacity is remembered with its full size after one look. Tests: image_reuse_tests; timings: real_file_bench_tests (FIGCRAFT_BENCH_FILE).