Rebuilding an Image Editor with LLMs: Costs, Architecture, and Engineering Limits

    AI coding tools can quickly produce an image editor’s interface, but a reliable product requires consistent document state, correct image processing, durable storage, and systematic testing. This article explains how to define a minimum end-to-end editing workflow, structure the architecture, validate reliability and performance, and assess the full cost of LLM-assisted development. It also outlines when rebuilding image-editing capabilities is worthwhile and when scope expansion should stop.

    1. A Similar Interface Is Not a Complete Rebuild

    When AI coding tools can quickly generate menus, toolbars, a canvas, and a layers panel, rebuilding a professional image editor can seem like a task that simply requires enough prompting. From a developer’s perspective, however, the interface is the easiest part to demonstrate—and one of the easiest to mistake for a complete system.

    A deliverable image editor needs at least three categories of capabilities:

    • Interaction: Zooming, panning, selection, dragging, shortcuts, and parameter adjustments. These determine whether users can complete editing tasks smoothly.
    • Image computation: Pixel compositing, alpha handling, selection operations, color adjustments, and filters. These determine whether editing results are correct.
    • Engineering reliability: Undo and redo, project saving, failure recovery, performance management, and data protection. These determine whether the software remains dependable over time.

    A claim of a “complete rebuild” therefore cannot be evaluated from screenshots or a single demonstration. More useful questions are whether the feature scope is defined, operations produce repeatable results, saved projects can be reopened, extended editing sessions remain stable, and failures can occur without losing data.

    Unverified claims about costs, token usage, or completion should be treated as information requiring confirmation, not as technical conclusions. Even substantial spending on code generation does not establish that a product has professional-grade capabilities.

    2. Why More Tokens Do Not Necessarily Produce Usable Software

    The central question is straightforward: if a project has consumed considerable money and generation resources, why might it still fail to produce a usable system?

    LLMs generate code and recommendations. They do not automatically deliver engineering outcomes. There is no dependable linear relationship between output volume and product quality.

    2.1 Ambiguous Requirements Amplify Wasted Generation

    “Build a complete image editor” has no clear acceptance criteria. A model may prioritize visible features—buttons, menus, and dialogs—while leaving foundational issues such as layer data structures, coordinate mapping, and project persistence unresolved.

    Without a consistent underlying model, adding features often creates duplicate implementations. The brush tool may maintain one coordinate system, the selection tool another, and the export module its own scaling logic. Each module may appear functional in isolation, yet combining them produces offsets, incorrect cropping, or alpha errors.

    Generating more tokens cannot resolve ambiguous requirements on its own.

    2.2 Repeated Patches Can Increase Coupling

    Without tests and architectural constraints, AI coding tools may respond to an error by changing nearby logic. A patch can solve the immediate problem while breaking another operation.

    For example, changing canvas scaling to fix export dimensions may misalign selections. Sharing pixel buffers to reduce history memory usage may allow later edits to modify earlier states unintentionally.

    The important question is not how much code was generated. It is whether each change has a clear objective, passes validation, and introduces additional risk.

    2.3 Software and Physical Systems Are Not Directly Comparable

    Image editors primarily manipulate digital state. Many behaviors can be tested using fixed inputs and expected outputs. Embodied devices also involve mechanical structures, sensor errors, actuator control, environmental changes, and safety constraints.

    Even when software can be generated quickly, physical devices still require experiments, calibration, and hardware validation. Both types of work illustrate the same principle: model inference resources are only one part of development investment. They cannot replace system integration and real-world validation.

    3. Define a Minimum End-to-End Workflow Before Claiming Completeness

    A sensible starting point is not the longest possible feature list. It is a workflow that functions from beginning to end:

    Import an image → create or adjust layers → edit → undo and redo → save the project → reopen it → export the result.

    This sequence captures the core value of an image editor. If any step is unreliable, a large collection of other features will not make the product deliverable.

    Requirements can be divided into three levels.

    Level 1: The Basic Editing Workflow

    This includes image import, canvas zooming and panning, a basic brush, layer visibility, opacity adjustment, undo and redo, and image export.

    The goal is state consistency rather than feature count. What users see, what the project file stores, and what the editor exports should all derive from the same document model.

    Level 2: Common Editing Capabilities

    This includes rectangular selections, cropping, layer movement, basic color adjustments, and simple filters.

    For every operation, define its target: the current layer, pixels within a selection, or the entire document. An unclear operation scope is a common cause of confusing interactions and incorrect results.

    Level 3: Advanced Capabilities

    This includes complex paths, text layout, high-bit-depth processing, more sophisticated color management, and optimization for large documents.

    These features usually have substantial technical complexity of their own and should not be folded directly into the minimum version. Text editing, for example, involves not only display but also font metrics, line-breaking rules, and stable layout results. Color management is more than a configuration option: image loading, display, computation, and export must handle color consistently.

    Controlling scope does not mean lowering technical ambitions. It means giving each objective a clear, testable boundary.

    4. Architecture: Separate the Interface, State, and Computation

    An image editor that is easier to extend and validate can be organized into five main modules.

    4.1 Document Model

    The document model stores canvas dimensions, layer order, layer properties, references to pixel data, and editing metadata. It should be the authoritative source of project state.

    The interface should not maintain a separate, complete copy of that state. Otherwise, the panel may indicate that an edit has been applied while export still uses old data.

    A layer can contain an identifier, name, visibility, opacity, transformation information, and pixel content. Its fields should reflect actual requirements rather than accumulating complex properties in pursuit of premature generality.

    4.2 Interaction Control

    The interaction module translates mouse, touch, and keyboard input into editing operations.

    It must distinguish between screen coordinates, canvas coordinates, and layer-local coordinates. Zooming and panning change the view; they should not unintentionally change the underlying image data. When layers are rotated or scaled, coordinate conversions must follow a consistent set of transformations.

    4.3 Rendering and Compositing

    The rendering module generates a preview from document state. For standard alpha compositing, the implementation must specify its color representation and whether it uses premultiplied alpha.

    As a simplified example, a single foreground layer over an opaque background can be composited as:

    Output color = foreground color × foreground alpha + background color × (1 − foreground alpha)

    This expression applies only under specific conditions. If the background is also transparent, output alpha must be calculated as well. If color values are represented in different spaces, they must first be handled consistently rather than inserted directly into the formula.

    4.4 Editing Commands and History

    Undoable operations should be organized as explicit commands. Each command applies a change and provides a corresponding way to restore the previous state.

    For a layer rename, storing the old and new names is sufficient. A brush operation can record pixel changes in the affected region. A large filter operation may use regional snapshots or document checkpoints.

    Copying the entire document for every operation is simple to implement but can cause rapid memory growth. The history strategy must balance implementation complexity, restoration speed, and memory consumption.

    4.5 Project Storage and Export

    Saving a project and exporting an image are different operations.

    A project file preserves layers and editing state so work can continue. An exported image usually contains only the composited result. Treating the two as interchangeable can mislead users into believing that all editing information remains recoverable after saving.

    The project format should also include a version identifier so future releases can assess compatibility. Saving should avoid directly overwriting the only valid copy. Writing to a temporary file and then replacing the existing file can reduce the risk of corruption during interruption, but the specific behavior still needs to be verified in the target runtime environment.

    5. Tests Demonstrate Completeness Better Than Demos

    Validation should cover numerical correctness, interaction consistency, and failure recovery.

    5.1 Validate Algorithms with Small Images

    Start with very small images whose pixel values can be calculated manually. Use them to test alpha compositing, crop boundaries, and selection behavior.

    For example, test fully transparent, fully opaque, and partially transparent layers, and check whether edge pixels match expectations. Operations involving interpolation or floating-point calculations should use reasonable tolerances rather than requiring every output to match byte for byte.

    5.2 Validate State with Operation Sequences

    Passing individual feature tests does not establish that combined operations are reliable.

    One useful sequence is:

    Import an image → add a layer → draw a stroke → move the layer → undo twice → redo once → save → reopen → export.

    The checks should establish whether document state, preview, and export remain consistent, and whether undo and redo restore the correct objects. Verifying that buttons are clickable is not enough.

    5.3 Validate Reliability Under Failure Conditions

    Tests should cover corrupted inputs, oversized dimensions, interrupted saves, insufficient memory, and prolonged editing sessions.

    Failure handling requires more than displaying an error message. It must also prevent the document from being left partially modified. For expensive operations that may fail, computation can first be performed on an isolated data copy or temporary result, then committed to the document only after success.

    5.4 Measure Performance Under Defined Conditions

    Relevant metrics include brush response latency, canvas redraw time, peak memory usage, project loading time, and export duration. Every measurement should state the test environment, input size, and operating conditions.

    Performance figures collected under inconsistent conditions are not a sound basis for comparing implementations. Optimization should follow actual measurements, not an immediate rewrite prompted by code that merely looks complicated.

    6. Use AI Coding Tools in a Bounded, Verifiable Development Loop

    A more effective collaboration model places the LLM inside a development process with clear boundaries and sufficient feedback.

    First, developers should define module responsibilities, data constraints, and acceptance criteria. Models can help generate local implementations, test cases, and documentation drafts, but major architectural decisions still require human review.

    Second, assign one verifiable task at a time. “Add boundary tests for layer alpha compositing” is more likely to produce a stable result than “keep improving the entire editor.”

    Third, provide context directly relevant to the task: necessary data structures, existing implementation details, and failing tests. Repeatedly sending large amounts of unrelated code increases consumption and can bury critical constraints.

    Finally, review every round of changes:

    • Do the tests pass?
    • Have interfaces changed?
    • Has duplicate logic been introduced?
    • Does the change affect saved-project compatibility?

    Generated results that cannot be validated should not enter the main development workflow.

    Cost assessment must also include the full investment:

    Total investment = model invocation costs + human review costs + testing costs + rework costs + operation and maintenance costs.

    Token usage helps track resource consumption, but it does not directly measure development progress. More useful indicators include accepted features, changes in critical defects, the success rate of core operations, and maintenance workload.

    7. When Rebuilding Makes Sense—and When to Stop Expanding

    Rebuilding image-editing capabilities can serve legitimate goals: testing a new interaction model, supporting a clearly defined internal workflow, or embedding simple editing into a business application. These scenarios do not require every professional feature, but they do require a stable, reliable target workflow.

    If the goal is only to demonstrate that a model can generate complex software, the project can drift into feature accumulation: more panels and options, without real user tasks or acceptance criteria.

    Before investing, answer three questions:

    1. What do target users need to accomplish, and what specifically obstructs their current workflow?
    2. How much of that problem can a minimum usable version solve, and which advanced features can be explicitly excluded?
    3. Can the team maintain the generated code, including fixing defects, addressing security issues, and preserving compatibility with existing projects?

    Learning from features and implementing them should not be confused with copying protected materials, branding, or interface assets. Even an independent implementation should verify the licensing of its resources and avoid unverified compatibility claims.

    Conclusion

    LLMs have lowered the barrier to generating code, but they have not removed the fundamentals of software engineering. The difficult part of rebuilding an image editor is making data, interaction, computation, and storage work together as a consistent, verifiable system.

    The value of an investment cannot be judged solely by its budget, token count, or visual resemblance to an existing application. It depends on whether the product delivers a reliable end-to-end editing workflow, solves a defined user problem, and remains maintainable.

    Rather than pursuing an undefined “complete rebuild,” start with image-editing capabilities that have clear scope, trustworthy results, and room to evolve. That is how AI-assisted coding becomes useful in production.