Skip to content

[Feature Request] Support physical units (cm, inches) and DPI/Resolution in "New canvas" #185

Description

@safvanedge

Problem / Limitation

Currently, the "New canvas" dialog only accepts raw pixel values (px) and has no concept of resolution (DPI / PPI). If a user attempts to enter a physical dimension like 10cm or 5in, it triggers the error:

"Enter whole numbers from 1 to 30,000 pixels."

For print workflows and graphic design, working with physical dimensions (inches, cm, mm) and print resolutions (e.g., 300 DPI vs 72 PPI for web) is essential.

Proposed Solution

  1. Unit Selector: Allow users to select units (px, in, cm, mm) next to Width and Height.
  2. Resolution (DPI) Field: Add a Resolution input (defaulting to 72 or 300 pixels/inch) that computes the appropriate pixel dimensions behind the scenes.
  3. Smart Input Parsing: If a user types 10cm or 4in directly into the dimension field, automatically recognize the unit and convert it to pixels based on the active resolution rather than rejecting it as an invalid integer.

Context

In NewCanvasSheet.swift, dimensions are currently restricted to static px and validated via CanvasDocument.validDimension as direct integers. Adding physical unit conversion and DPI metadata would significantly improve the workflow for print designers.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions