Skip to content

Move 2D adjustment rendering and color replacement into a tiled worker #165

Done

Description

@vycdev

Summary

Large images make the 2D adjustment preview and full-resolution edits slow on the main thread. #156 adds a shared worker that processes images in 128×128 tiles, plus a color-replacement step that thresholds, the filament matcher and nozzle patching all build on. This issue covers only that shared base, so the features can land on top of it separately.

Scope

  • Tiled rendering of the existing adjustments (with a one-pixel halo so tile seams match full-frame output) and color replacement.
  • A worker protocol with cancellation that later features add their own request types to.
  • An ImageEditSnapshot type in src/types/index.ts.

Constraints

  • Measure first. This replaces the preview path every user goes through, so the PR should show before/after timings on a large image.
  • Keep one worker alive. Don't start and terminate a new worker for every preview render.
  • Fail visibly. If a render fails, say so and allow a retry. Don't silently show the unadjusted image while adjustments are still selected.
  • Fallback. Keep a main-thread path where OffscreenCanvas 2D isn't available (older Safari/WKWebView builds).
  • Output must match the current pixels exactly; add a test that compares tiled and full-frame results.

Related to #131 (repeated decoding on import), but this doesn't fix it. Split from #156.

Activity

  1. added
    enhancement
    on Nov 16, 2026
  2. vycdev commented on Dec 1, 2026

    @vycdev
    OwnerAuthor

    Fixed in develop by #261. It ships in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions