You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Squash-merge of kvz/collage-intent: add `image merge` intent and sync `/image/merge` schema for the new polaroid-stack and mosaic effects shipped in transloadit/api2#7651.
- Uses the shared file input and output flags listed above.
380
+
- Also supports the shared base processing flags listed above.
381
+
382
+
**Command options**
383
+
384
+
| Flag | Type | Required | Example | Description |
385
+
| --- | --- | --- | --- | --- |
386
+
|`--format`|`string`| no |`jpg`| The output format for the modified image. |
387
+
|`--direction`|`string`| no |`horizontal`| Specifies the direction which the images are displayed. Only applies to the default spritesheet layout. Ignored when effect is set to polaroid-stack or mosaic, as those effects… |
388
+
|`--effect`|`string`| no |`mosaic`| Applies a styled collage layout instead of a plain horizontal or vertical spritesheet. |
389
+
|`--border`|`number`| no |`1`| An integer value which defines the gap between images on the spritesheet. |
390
+
|`--background`|`string`| no |`transparent`| Either the hexadecimal code or name of the color used to fill the background (only shown with a border > 1). |
391
+
|`--width`|`number`| no |`1`| The output canvas width in pixels. This is mainly used by styled effects such as polaroid-stack and mosaic. |
392
+
|`--height`|`number`| no |`1`| The output canvas height in pixels. This is mainly used by styled effects such as polaroid-stack and mosaic. |
393
+
|`--seed`|`number`| no |`1`| Optional deterministic seed used by styled effects such as polaroid-stack and mosaic. |
394
+
|`--shuffle`|`boolean`| no |`true`| Whether styled effects such as polaroid-stack and mosaic may shuffle the input order before laying out the canvas. |
395
+
|`--coverage`|`number`| no |`1`| Area-coverage multiplier for the polaroid-stack effect. Controls how large each polaroid is relative to the canvas and consequently how much of the canvas is covered by photos.… |
396
+
|`--adaptive-filtering`|`boolean`| no |`true`| Controls the image compression for PNG images. Setting to true results in smaller file size, while increasing processing time. It is encouraged to keep this option disabled. |
397
+
|`--quality`|`number`| no |`1`| Controls the image compression for JPG, PNG, and WebP images. Please also take a look at 🤖/image/optimize. |
- Uses the shared file input and output flags listed above.
248
+
- Also supports the shared base processing flags listed above.
249
+
250
+
**Command options**
251
+
252
+
| Flag | Type | Required | Example | Description |
253
+
| --- | --- | --- | --- | --- |
254
+
|`--format`|`string`| no |`jpg`| The output format for the modified image. |
255
+
|`--direction`|`string`| no |`horizontal`| Specifies the direction which the images are displayed. Only applies to the default spritesheet layout. Ignored when effect is set to polaroid-stack or mosaic, as those effects… |
256
+
|`--effect`|`string`| no |`mosaic`| Applies a styled collage layout instead of a plain horizontal or vertical spritesheet. |
257
+
|`--border`|`number`| no |`1`| An integer value which defines the gap between images on the spritesheet. |
258
+
|`--background`|`string`| no |`transparent`| Either the hexadecimal code or name of the color used to fill the background (only shown with a border > 1). |
259
+
|`--width`|`number`| no |`1`| The output canvas width in pixels. This is mainly used by styled effects such as polaroid-stack and mosaic. |
260
+
|`--height`|`number`| no |`1`| The output canvas height in pixels. This is mainly used by styled effects such as polaroid-stack and mosaic. |
261
+
|`--seed`|`number`| no |`1`| Optional deterministic seed used by styled effects such as polaroid-stack and mosaic. |
262
+
|`--shuffle`|`boolean`| no |`true`| Whether styled effects such as polaroid-stack and mosaic may shuffle the input order before laying out the canvas. |
263
+
|`--coverage`|`number`| no |`1`| Area-coverage multiplier for the polaroid-stack effect. Controls how large each polaroid is relative to the canvas and consequently how much of the canvas is covered by photos.… |
264
+
|`--adaptive-filtering`|`boolean`| no |`true`| Controls the image compression for PNG images. Setting to true results in smaller file size, while increasing processing time. It is encouraged to keep this option disabled. |
265
+
|`--quality`|`number`| no |`1`| Controls the image compression for JPG, PNG, and WebP images. Please also take a look at 🤖/image/optimize. |
@@ -59,13 +58,25 @@ It's recommended to use this Robot with
59
58
similar size before merging them.
60
59
`),
61
60
format: z
62
-
.enum(['jpg','png'])
61
+
.enum(['jpg','png','webp'])
63
62
.default('png')
64
63
.describe('The output format for the modified image.'),
65
64
direction: z
66
65
.enum(['horizontal','vertical'])
67
66
.default('horizontal')
68
-
.describe('Specifies the direction which the images are displayed.'),
67
+
.describe(`
68
+
Specifies the direction which the images are displayed.
69
+
70
+
Only applies to the default spritesheet layout. Ignored when \`effect\` is set to \`polaroid-stack\` or \`mosaic\`, as those effects use their own layout algorithms.
71
+
`),
72
+
effect: z
73
+
.enum(['mosaic','polaroid-stack'])
74
+
.optional()
75
+
.describe(`
76
+
Applies a styled collage layout instead of a plain horizontal or vertical spritesheet.
77
+
78
+
Currently supports \`polaroid-stack\`, which renders the inputs as overlapping instant photos on a canvas, and \`mosaic\`, which builds a justified tiled collage.
79
+
`),
69
80
// TODO: default is not between 1 and 10
70
81
border: z
71
82
.number()
@@ -75,21 +86,78 @@ similar size before merging them.
75
86
An integer value which defines the gap between images on the spritesheet.
76
87
77
88
A value of \`10\` would cause the images to have the largest gap between them, while a value of \`1\` would place the images side-by-side.
89
+
90
+
When \`effect\` is \`polaroid-stack\`, this value is instead used as canvas padding so the outermost photos keep that many pixels of distance from the edge.
91
+
92
+
When \`effect\` is \`mosaic\`, this value is used both as the outer canvas padding and as the gutter width between neighbouring tiles.
Either the hexadecimal code or [name](https://www.imagemagick.org/script/color.php#color_names) of the color used to fill the background (only shown with a border > 1).
81
96
82
-
By default, the background of transparent images is changed to white.
97
+
By default, the background of transparent images is changed to white. Set to \`none\` or \`transparent\` for a transparent canvas — requires \`format\` \`png\` or \`webp\` to preserve alpha.
83
98
84
99
For details about how to preserve transparency across all image types, see [this demo](/demos/image-manipulation/properly-preserve-transparency-across-all-image-types/).
100
+
`),
101
+
width: z
102
+
.number()
103
+
.int()
104
+
.positive()
105
+
.optional()
106
+
.describe(`
107
+
The output canvas width in pixels.
108
+
109
+
This is mainly used by styled effects such as \`polaroid-stack\` and \`mosaic\`.
110
+
`),
111
+
height: z
112
+
.number()
113
+
.int()
114
+
.positive()
115
+
.optional()
116
+
.describe(`
117
+
The output canvas height in pixels.
118
+
119
+
This is mainly used by styled effects such as \`polaroid-stack\` and \`mosaic\`.
120
+
`),
121
+
seed: z
122
+
.number()
123
+
.int()
124
+
.optional()
125
+
.describe(`
126
+
Optional deterministic seed used by styled effects such as \`polaroid-stack\` and \`mosaic\`.
127
+
`),
128
+
shuffle: z
129
+
.boolean()
130
+
.default(false)
131
+
.describe(`
132
+
Whether styled effects such as \`polaroid-stack\` and \`mosaic\` may shuffle the input order before laying out the canvas.
133
+
`),
134
+
coverage: z
135
+
.number()
136
+
.min(0.5)
137
+
.max(3)
138
+
.optional()
139
+
.describe(`
140
+
Area-coverage multiplier for the \`polaroid-stack\` effect. Controls how large each polaroid is relative to the canvas and consequently how much of the canvas is covered by photos.
141
+
142
+
The default of \`1.5\` leaves a subtle beige border along some edges. Use \`2.0\`–\`2.5\` for edge-to-edge coverage (photos overlap more). Values below \`1.0\` produce smaller, more widely spaced polaroids.
143
+
144
+
Has no effect on the \`mosaic\` style or on plain spritesheets.
85
145
`),
86
146
adaptive_filtering: z
87
147
.boolean()
88
148
.default(false)
89
149
.describe(`
90
150
Controls the image compression for PNG images. Setting to \`true\` results in smaller file size, while increasing processing time. It is encouraged to keep this option disabled.
91
151
`),
92
-
quality: imageQualitySchema,
152
+
quality: z
153
+
.number()
154
+
.int()
155
+
.min(1)
156
+
.max(100)
157
+
.default(100)
158
+
.describe(`
159
+
Controls the image compression for JPG, PNG, and WebP images. Please also take a look at [🤖/image/optimize](/docs/robots/image-optimize/).
0 commit comments