Offer standard web and print canvas formats
The canvas was two spin buttons, so "an Instagram story" or "A4 at 300 dpi" was a number the user had to work out. src/core/canvas.cpp now holds one table of standard sizes both front-ends read: a web format is a fixed pixel size, a print format a sheet in millimetres that becomes pixels at a dpi. Adding a format is a line in canvasFormats() — the dropdown, --format and --help all walk the table. The pixels stay the truth everywhere; renderChain never hears about formats. A format is the presentation of a canvas, carried alongside the pixels in Options and Project and empty for a custom size, and where one is named it decides the pixels — so a project saved as A4 reopens as A4 rather than as whatever it happened to measure. In the interface a format fills the width and height in and greys them out rather than hiding them: the size a sheet works out to is worth seeing. A print format also shows a DPI row, and Custom hands the spins back keeping the last size, which makes starting from a format and then tweaking it the ordinary path. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,22 @@ build/effector -o out.png -s 1920x1080 \
|
||||
--strip-height 8 --jitter 4 --seed 42 photo1.jpg photo2.png
|
||||
```
|
||||
|
||||
The canvas is either a size in pixels (`-s 1920x1080`, the Custom entry in the
|
||||
interface) or one of the standard formats, which `--help` lists in full:
|
||||
|
||||
```bash
|
||||
build/effector -o post.png --format instagram-post -e tiles
|
||||
build/effector -o sheet.png --format a4 --dpi 300 -e scanlines
|
||||
```
|
||||
|
||||
A web format — the Instagram sizes, Full HD, 4K UHD — is a fixed pixel size. A
|
||||
print format — A5, A4, A3, US Letter — is a sheet of paper, and becomes pixels
|
||||
at `--dpi` (36–1200, 300 by default), so A4 at 300 dpi is 2480×3508. Picking a
|
||||
format in the interface fills the width and height in and greys them out;
|
||||
Custom hands them back, keeping whatever the format last worked out to. A
|
||||
format is saved with the project, so an A4 project reopens as A4 rather than as
|
||||
the pixels it happened to be.
|
||||
|
||||
Any option can also be passed when launching the interface; it becomes the
|
||||
starting state (images, canvas size, effect settings, seed).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user