@mediaproc/image 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +2516 -0
  2. package/bin/cli.js +6 -0
  3. package/dist/cli.d.ts +3 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +89 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/commands/auto-enhance.d.ts +3 -0
  8. package/dist/commands/auto-enhance.d.ts.map +1 -0
  9. package/dist/commands/auto-enhance.js +148 -0
  10. package/dist/commands/auto-enhance.js.map +1 -0
  11. package/dist/commands/batch.d.ts +3 -0
  12. package/dist/commands/batch.d.ts.map +1 -0
  13. package/dist/commands/batch.js +230 -0
  14. package/dist/commands/batch.js.map +1 -0
  15. package/dist/commands/blur.d.ts +3 -0
  16. package/dist/commands/blur.d.ts.map +1 -0
  17. package/dist/commands/blur.js +122 -0
  18. package/dist/commands/blur.js.map +1 -0
  19. package/dist/commands/border.d.ts +3 -0
  20. package/dist/commands/border.d.ts.map +1 -0
  21. package/dist/commands/border.js +122 -0
  22. package/dist/commands/border.js.map +1 -0
  23. package/dist/commands/clahe.d.ts +3 -0
  24. package/dist/commands/clahe.d.ts.map +1 -0
  25. package/dist/commands/clahe.js +121 -0
  26. package/dist/commands/clahe.js.map +1 -0
  27. package/dist/commands/composite.d.ts +3 -0
  28. package/dist/commands/composite.d.ts.map +1 -0
  29. package/dist/commands/composite.js +167 -0
  30. package/dist/commands/composite.js.map +1 -0
  31. package/dist/commands/convert.d.ts +3 -0
  32. package/dist/commands/convert.d.ts.map +1 -0
  33. package/dist/commands/convert.js +136 -0
  34. package/dist/commands/convert.js.map +1 -0
  35. package/dist/commands/convolve.d.ts +3 -0
  36. package/dist/commands/convolve.d.ts.map +1 -0
  37. package/dist/commands/convolve.js +171 -0
  38. package/dist/commands/convolve.js.map +1 -0
  39. package/dist/commands/crop.d.ts +3 -0
  40. package/dist/commands/crop.d.ts.map +1 -0
  41. package/dist/commands/crop.js +120 -0
  42. package/dist/commands/crop.js.map +1 -0
  43. package/dist/commands/dominant-color.d.ts +3 -0
  44. package/dist/commands/dominant-color.d.ts.map +1 -0
  45. package/dist/commands/dominant-color.js +175 -0
  46. package/dist/commands/dominant-color.js.map +1 -0
  47. package/dist/commands/extend.d.ts +3 -0
  48. package/dist/commands/extend.d.ts.map +1 -0
  49. package/dist/commands/extend.js +146 -0
  50. package/dist/commands/extend.js.map +1 -0
  51. package/dist/commands/extract.d.ts +3 -0
  52. package/dist/commands/extract.d.ts.map +1 -0
  53. package/dist/commands/extract.js +169 -0
  54. package/dist/commands/extract.js.map +1 -0
  55. package/dist/commands/flip.d.ts +3 -0
  56. package/dist/commands/flip.d.ts.map +1 -0
  57. package/dist/commands/flip.js +112 -0
  58. package/dist/commands/flip.js.map +1 -0
  59. package/dist/commands/gamma.d.ts +3 -0
  60. package/dist/commands/gamma.d.ts.map +1 -0
  61. package/dist/commands/gamma.js +129 -0
  62. package/dist/commands/gamma.js.map +1 -0
  63. package/dist/commands/grayscale.d.ts +3 -0
  64. package/dist/commands/grayscale.d.ts.map +1 -0
  65. package/dist/commands/grayscale.js +94 -0
  66. package/dist/commands/grayscale.js.map +1 -0
  67. package/dist/commands/grid.d.ts +3 -0
  68. package/dist/commands/grid.d.ts.map +1 -0
  69. package/dist/commands/grid.js +193 -0
  70. package/dist/commands/grid.js.map +1 -0
  71. package/dist/commands/median.d.ts +3 -0
  72. package/dist/commands/median.d.ts.map +1 -0
  73. package/dist/commands/median.js +132 -0
  74. package/dist/commands/median.js.map +1 -0
  75. package/dist/commands/metadata-cmd.d.ts +3 -0
  76. package/dist/commands/metadata-cmd.d.ts.map +1 -0
  77. package/dist/commands/metadata-cmd.js +201 -0
  78. package/dist/commands/metadata-cmd.js.map +1 -0
  79. package/dist/commands/mirror.d.ts +3 -0
  80. package/dist/commands/mirror.d.ts.map +1 -0
  81. package/dist/commands/mirror.js +218 -0
  82. package/dist/commands/mirror.js.map +1 -0
  83. package/dist/commands/modulate.d.ts +3 -0
  84. package/dist/commands/modulate.d.ts.map +1 -0
  85. package/dist/commands/modulate.js +151 -0
  86. package/dist/commands/modulate.js.map +1 -0
  87. package/dist/commands/negate.d.ts +3 -0
  88. package/dist/commands/negate.d.ts.map +1 -0
  89. package/dist/commands/negate.js +111 -0
  90. package/dist/commands/negate.js.map +1 -0
  91. package/dist/commands/normalize.d.ts +3 -0
  92. package/dist/commands/normalize.d.ts.map +1 -0
  93. package/dist/commands/normalize.js +119 -0
  94. package/dist/commands/normalize.js.map +1 -0
  95. package/dist/commands/optimize.d.ts +3 -0
  96. package/dist/commands/optimize.d.ts.map +1 -0
  97. package/dist/commands/optimize.js +137 -0
  98. package/dist/commands/optimize.js.map +1 -0
  99. package/dist/commands/palette.d.ts +3 -0
  100. package/dist/commands/palette.d.ts.map +1 -0
  101. package/dist/commands/palette.js +138 -0
  102. package/dist/commands/palette.js.map +1 -0
  103. package/dist/commands/pixelate.d.ts +3 -0
  104. package/dist/commands/pixelate.d.ts.map +1 -0
  105. package/dist/commands/pixelate.js +123 -0
  106. package/dist/commands/pixelate.js.map +1 -0
  107. package/dist/commands/resize.d.ts +3 -0
  108. package/dist/commands/resize.d.ts.map +1 -0
  109. package/dist/commands/resize.js +187 -0
  110. package/dist/commands/resize.js.map +1 -0
  111. package/dist/commands/rotate.d.ts +3 -0
  112. package/dist/commands/rotate.d.ts.map +1 -0
  113. package/dist/commands/rotate.js +103 -0
  114. package/dist/commands/rotate.js.map +1 -0
  115. package/dist/commands/sepia.d.ts +3 -0
  116. package/dist/commands/sepia.d.ts.map +1 -0
  117. package/dist/commands/sepia.js +119 -0
  118. package/dist/commands/sepia.js.map +1 -0
  119. package/dist/commands/sharpen.d.ts +3 -0
  120. package/dist/commands/sharpen.d.ts.map +1 -0
  121. package/dist/commands/sharpen.js +123 -0
  122. package/dist/commands/sharpen.js.map +1 -0
  123. package/dist/commands/smart-crop.d.ts +3 -0
  124. package/dist/commands/smart-crop.d.ts.map +1 -0
  125. package/dist/commands/smart-crop.js +137 -0
  126. package/dist/commands/smart-crop.js.map +1 -0
  127. package/dist/commands/split.d.ts +3 -0
  128. package/dist/commands/split.d.ts.map +1 -0
  129. package/dist/commands/split.js +177 -0
  130. package/dist/commands/split.js.map +1 -0
  131. package/dist/commands/stack.d.ts +3 -0
  132. package/dist/commands/stack.d.ts.map +1 -0
  133. package/dist/commands/stack.js +205 -0
  134. package/dist/commands/stack.js.map +1 -0
  135. package/dist/commands/stats.d.ts +3 -0
  136. package/dist/commands/stats.d.ts.map +1 -0
  137. package/dist/commands/stats.js +187 -0
  138. package/dist/commands/stats.js.map +1 -0
  139. package/dist/commands/thumbnail.d.ts +3 -0
  140. package/dist/commands/thumbnail.d.ts.map +1 -0
  141. package/dist/commands/thumbnail.js +131 -0
  142. package/dist/commands/thumbnail.js.map +1 -0
  143. package/dist/commands/tint.d.ts +3 -0
  144. package/dist/commands/tint.d.ts.map +1 -0
  145. package/dist/commands/tint.js +123 -0
  146. package/dist/commands/tint.js.map +1 -0
  147. package/dist/commands/trim.d.ts +3 -0
  148. package/dist/commands/trim.d.ts.map +1 -0
  149. package/dist/commands/trim.js +123 -0
  150. package/dist/commands/trim.js.map +1 -0
  151. package/dist/commands/vignette.d.ts +3 -0
  152. package/dist/commands/vignette.d.ts.map +1 -0
  153. package/dist/commands/vignette.js +139 -0
  154. package/dist/commands/vignette.js.map +1 -0
  155. package/dist/commands/watermark.d.ts +3 -0
  156. package/dist/commands/watermark.d.ts.map +1 -0
  157. package/dist/commands/watermark.js +172 -0
  158. package/dist/commands/watermark.js.map +1 -0
  159. package/dist/index.d.ts +3 -0
  160. package/dist/index.d.ts.map +1 -0
  161. package/dist/index.js +2 -0
  162. package/dist/index.js.map +1 -0
  163. package/dist/register.d.ts +5 -0
  164. package/dist/register.d.ts.map +1 -0
  165. package/dist/register.js +93 -0
  166. package/dist/register.js.map +1 -0
  167. package/dist/types.d.ts +91 -0
  168. package/dist/types.d.ts.map +1 -0
  169. package/dist/types.js +2 -0
  170. package/dist/types.js.map +1 -0
  171. package/dist/utils/helpFormatter.d.ts +63 -0
  172. package/dist/utils/helpFormatter.d.ts.map +1 -0
  173. package/dist/utils/helpFormatter.js +171 -0
  174. package/dist/utils/helpFormatter.js.map +1 -0
  175. package/dist/utils/sharp.d.ts +20 -0
  176. package/dist/utils/sharp.d.ts.map +1 -0
  177. package/dist/utils/sharp.js +14 -0
  178. package/dist/utils/sharp.js.map +1 -0
  179. package/package.json +55 -0
package/README.md ADDED
@@ -0,0 +1,2516 @@
1
+ # 📸 MediaProc Image Plugin
2
+
3
+ Professional image processing CLI powered by [Sharp](https://sharp.pixelplumbing.com/). Fast, efficient, and feature-rich image manipulation toolkit with **40 comprehensive commands**.
4
+
5
+ ## 📑 Table of Contents
6
+
7
+ - [Features](#-features)
8
+ - [Installation & Usage](#-installation--usage)
9
+ - [Quick Start](#-quick-start)
10
+ - [Commands Overview](#-commands-overview)
11
+ - [Detailed Command Reference](#-detailed-command-reference)
12
+ - [Transform & Resize](#-transform--resize-7-commands)
13
+ - [Color & Tone](#-color--tone-6-commands)
14
+ - [Effects & Filters](#-effects--filters-6-commands)
15
+ - [Advanced Operations](#-advanced-operations-6-commands)
16
+ - [Smart/AI Operations](#-smartai-operations-6-commands)
17
+ - [Utility Commands](#-utility-9-commands)
18
+ - [Real-World Workflows](#-real-world-workflows)
19
+ - [Global Options](#-global-options)
20
+ - [Usage Tips](#-usage-tips)
21
+ - [Troubleshooting](#-troubleshooting)
22
+
23
+ ---
24
+
25
+ ## ✨ Features
26
+
27
+ - 🚀 **High Performance** - Built on libvips for blazing fast processing
28
+ - 🎨 **40 Commands** - Comprehensive + custom image manipulation toolkit
29
+ - 🔧 **Professional Features** - Quality control, dry-run mode, verbose logging
30
+ - 📦 **Modern Formats** - WebP, AVIF, JPEG, PNG, TIFF, GIF support
31
+ - 🎯 **Simple CLI** - Intuitive command-line interface
32
+ - 💡 **Helpful Documentation** - Built-in help for every command
33
+ - 🤖 **Smart Operations** - AI-like auto-enhance, smart crop, batch processing
34
+
35
+ ## 📦 Installation & Usage
36
+
37
+ ### Option 1: Universal CLI (Recommended)
38
+
39
+ Install the universal CLI and add the image plugin:
40
+
41
+ ```bash
42
+ # Install universal CLI
43
+ npm install -g @mediaproc/cli
44
+
45
+ # Add image plugin (downloaded on-demand)
46
+ mediaproc add image
47
+
48
+ # Use commands with "image" prefix
49
+ mediaproc image resize photo.jpg -w 800 -h 600
50
+ mediaproc image convert photo.jpg -f webp
51
+ ```
52
+
53
+ **Note:** All commands use the `image` namespace: `mediaproc image <command>`
54
+
55
+ ### Option 2: Standalone Plugin
56
+
57
+ Install and use the image plugin independently:
58
+
59
+ ```bash
60
+ # Install standalone
61
+ npm install -g @mediaproc/image
62
+
63
+ # Use commands directly (no "image" prefix)
64
+ mediaproc-image resize photo.jpg -w 800 -h 600
65
+ mediaproc-image convert photo.jpg -f webp
66
+ ```
67
+
68
+ **Note:** Standalone mode uses `mediaproc-image` command without the `image` prefix.
69
+
70
+ ---
71
+
72
+ ## 🎯 Quick Start
73
+
74
+ **With Universal CLI:**
75
+ ```bash
76
+ # Resize an image
77
+ mediaproc image resize photo.jpg -w 800 -h 600
78
+
79
+ # Convert to WebP
80
+ mediaproc image convert photo.jpg -f webp -q 85
81
+
82
+ # Generate thumbnail
83
+ mediaproc image thumbnail photo.jpg -s 150
84
+
85
+ # Optimize for web
86
+ mediaproc image optimize photo.jpg -q 85
87
+
88
+ # Get help for any command
89
+ mediaproc image resize --help
90
+ ```
91
+
92
+ **With Standalone Plugin:**
93
+ ```bash
94
+ # Same commands, different prefix
95
+ mediaproc-image resize photo.jpg -w 800 -h 600
96
+ mediaproc-image convert photo.jpg -f webp -q 85
97
+ mediaproc-image thumbnail photo.jpg -s 150
98
+ ```
99
+
100
+ ## 📋 Commands Overview
101
+
102
+ ### 🔄 Transform & Resize
103
+ - **resize** - Resize images with advanced fit modes
104
+ - **crop** - Extract rectangular regions
105
+ - **rotate** - Rotate by any angle
106
+ - **flip** - Mirror horizontally/vertically
107
+ - **trim** - Auto-remove borders
108
+ - **extend** - Add padding/borders
109
+ - **thumbnail** - Generate thumbnails
110
+
111
+ ### 🎨 Color & Tone
112
+ - **modulate** - Adjust brightness, saturation, hue
113
+ - **gamma** - Apply gamma correction
114
+ - **tint** - Apply color tint overlay
115
+ - **grayscale** - Convert to black & white
116
+ - **negate** - Create negative image
117
+ - **normalize** - Auto-enhance contrast
118
+
119
+ ### ✨ Effects & Filters
120
+ - **blur** - Gaussian blur effect
121
+ - **sharpen** - Enhance image details
122
+ - **median** - Noise reduction filter
123
+ - **sepia** - Vintage sepia tone effect
124
+ - **vignette** - Darken edges for focus
125
+ - **pixelate** - Retro pixel art effect
126
+
127
+ ### 🎯 Advanced Operations
128
+ - **composite** - Layer images with blending
129
+ - **extract** - Extract channels or regions
130
+ - **border** - Add decorative frames
131
+ - **clahe** - Contrast enhancement (medical imaging)
132
+ - **convolve** - Custom kernel filters
133
+
134
+ ### 🤖 Smart/AI Operations
135
+ - **smart-crop** - Intelligent content-aware cropping
136
+ - **auto-enhance** - Automatic image enhancement
137
+ - **palette** - Extract dominant color palette
138
+ - **dominant-color** - Quick dominant color extraction
139
+ - **grid** - Combine images into collage layouts
140
+ - **batch** - Process multiple images at once
141
+
142
+ ### 🔧 Utility
143
+ - **convert** - Format conversion
144
+ - **optimize** - Size optimization
145
+ - **watermark** - Add watermarks
146
+ - **stats** - Detailed image information
147
+ - **split** - Split image into tiles
148
+ - **stack** - Stack images horizontally/vertically
149
+ - **mirror** - Create mirror/kaleidoscope effects
150
+ - **metadata** - View/export/remove EXIF data
151
+
152
+ ---
153
+
154
+ ## 📚 Detailed Command Reference
155
+
156
+ ### 1. **resize** - Resize Images
157
+
158
+ Resize images with advanced options for fit modes, aspect ratio control, and quality settings.
159
+
160
+ **Usage:**
161
+ ```bash
162
+ mediaproc image resize <input> [options]
163
+ ```
164
+
165
+ **Options:**
166
+ - `-w, --width <width>` - Target width in pixels
167
+ - `-h, --height <height>` - Target height in pixels
168
+ - `--fit <mode>` - Fit mode: cover, contain, fill, inside, outside (default: cover)
169
+ - `--position <position>` - Position for cover/contain: center, top, bottom, left, right, etc.
170
+ - `--kernel <kernel>` - Resampling kernel: nearest, cubic, mitchell, lanczos2, lanczos3 (default: lanczos3)
171
+ - `--no-enlarge` - Don't enlarge if image is smaller than target
172
+ - `--no-reduce` - Don't reduce if image is larger than target
173
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
174
+ - `-o, --output <path>` - Output file path
175
+ - `--dry-run` - Preview without executing
176
+ - `-v, --verbose` - Show detailed output
177
+ - `--help` - Display help
178
+
179
+ **Examples:**
180
+ ```bash
181
+ # Resize to 800x600 (crop to fit)
182
+ mediaproc image resize photo.jpg -w 800 -h 600
183
+
184
+ # Resize to fit within 1920x1080 (no cropping)
185
+ mediaproc image resize photo.jpg -w 1920 -h 1080 --fit contain
186
+
187
+ # Resize width only (maintain aspect ratio)
188
+ mediaproc image resize photo.jpg -w 1000
189
+
190
+ # High-quality resize with lanczos3 kernel
191
+ mediaproc image resize photo.jpg -w 2000 --kernel lanczos3 -q 95
192
+ ```
193
+
194
+ **Fit Modes:**
195
+ - **cover** - Fill entire area, crop if needed (default)
196
+ - **contain** - Fit inside with padding
197
+ - **fill** - Stretch to fill (may distort)
198
+ - **inside** - Shrink if larger
199
+ - **outside** - Enlarge to cover
200
+
201
+ ---
202
+
203
+ ### 2. **convert** - Format Conversion
204
+
205
+ Convert images between formats with quality control and compression options.
206
+
207
+ **Usage:**
208
+ ```bash
209
+ mediaproc image convert <input> [options]
210
+ ```
211
+
212
+ **Options:**
213
+ - `-f, --format <format>` - Output format: jpg, png, webp, avif, tiff, gif (default: webp)
214
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
215
+ - `--compression <level>` - PNG compression level 0-9 (default: 9)
216
+ - `--progressive` - Use progressive/interlaced format
217
+ - `-o, --output <path>` - Output file path
218
+ - `--dry-run` - Preview without executing
219
+ - `-v, --verbose` - Show detailed output
220
+ - `--help` - Display help
221
+
222
+ **Examples:**
223
+ ```bash
224
+ # Convert to WebP
225
+ mediaproc image convert photo.jpg -f webp
226
+
227
+ # Convert to AVIF with quality 80
228
+ mediaproc image convert image.png -f avif -q 80
229
+
230
+ # Convert to progressive JPEG
231
+ mediaproc image convert photo.png -f jpg --progressive
232
+
233
+ # Convert to PNG with max compression
234
+ mediaproc image convert photo.jpg -f png --compression 9
235
+ ```
236
+
237
+ **Format Guide:**
238
+ - **WebP** - Modern format, 25-35% smaller than JPG/PNG
239
+ - **AVIF** - Newest format, even smaller than WebP
240
+ - **JPG** - Best for photos, lossy compression
241
+ - **PNG** - Best for graphics/transparency, lossless
242
+ - **TIFF** - Professional/print, very large files
243
+ - **GIF** - Animations, limited colors
244
+
245
+ ---
246
+
247
+ ### 3. **grayscale** - Convert to Black & White
248
+
249
+ Convert images to grayscale (black and white).
250
+
251
+ **Usage:**
252
+ ```bash
253
+ mediaproc image grayscale <input> [options]
254
+ ```
255
+
256
+ **Options:**
257
+ - `-o, --output <path>` - Output file path
258
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
259
+ - `--dry-run` - Preview without executing
260
+ - `-v, --verbose` - Show detailed output
261
+ - `--help` - Display help
262
+
263
+ **Examples:**
264
+ ```bash
265
+ # Convert to grayscale
266
+ mediaproc image grayscale photo.jpg
267
+
268
+ # Grayscale with custom output
269
+ mediaproc image grayscale photo.jpg -o bw-photo.jpg
270
+
271
+ # Also works with UK spelling
272
+ mediaproc image greyscale photo.jpg
273
+ ```
274
+
275
+ **Use Cases:**
276
+ - Artistic black and white photography
277
+ - Document scanning
278
+ - Reducing file size
279
+ - Accessibility (colorblind-friendly)
280
+ - Classic/vintage aesthetic
281
+
282
+ ---
283
+
284
+ ### 4. **blur** - Gaussian Blur
285
+
286
+ Apply Gaussian blur effect with configurable strength.
287
+
288
+ **Usage:**
289
+ ```bash
290
+ mediaproc image blur <input> [options]
291
+ ```
292
+
293
+ **Options:**
294
+ - `-s, --sigma <sigma>` - Blur strength 0.3-1000 (default: 5)
295
+ - `-o, --output <path>` - Output file path
296
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
297
+ - `--dry-run` - Preview without executing
298
+ - `-v, --verbose` - Show detailed output
299
+ - `--help` - Display help
300
+
301
+ **Examples:**
302
+ ```bash
303
+ # Default blur
304
+ mediaproc image blur photo.jpg
305
+
306
+ # Strong blur
307
+ mediaproc image blur photo.jpg -s 20
308
+
309
+ # Subtle blur
310
+ mediaproc image blur photo.jpg -s 2
311
+ ```
312
+
313
+ **Blur Strength Guide:**
314
+ - **1-5** - Light blur (slight softness)
315
+ - **5-15** - Medium blur (noticeable effect)
316
+ - **15-30** - Strong blur (heavy softness)
317
+ - **30+** - Heavy blur (abstract effect)
318
+
319
+ ---
320
+
321
+ ### 5. **sharpen** - Sharpen Images
322
+
323
+ Sharpen images to enhance details and edges.
324
+
325
+ **Usage:**
326
+ ```bash
327
+ mediaproc image sharpen <input> [options]
328
+ ```
329
+
330
+ **Options:**
331
+ - `-s, --sigma <sigma>` - Sharpening strength 0.01-10 (default: 1)
332
+ - `--flat <flat>` - Sharpening for flat areas (default: 1)
333
+ - `--jagged <jagged>` - Sharpening for jagged areas (default: 2)
334
+ - `-o, --output <path>` - Output file path
335
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
336
+ - `--dry-run` - Preview without executing
337
+ - `-v, --verbose` - Show detailed output
338
+ - `--help` - Display help
339
+
340
+ **Examples:**
341
+ ```bash
342
+ # Default sharpening
343
+ mediaproc image sharpen photo.jpg
344
+
345
+ # Strong sharpening
346
+ mediaproc image sharpen image.png -s 2
347
+
348
+ # Custom parameters
349
+ mediaproc image sharpen photo.jpg -s 1.5 --flat 1.5 --jagged 2.5
350
+ ```
351
+
352
+ **Sharpening Guide:**
353
+ - **0.3-0.7** - Subtle enhancement
354
+ - **1.0-1.5** - Normal sharpening
355
+ - **2.0-3.0** - Strong sharpening
356
+ - **3.0+** - Extreme (risk of artifacts)
357
+
358
+ ---
359
+
360
+ ### 6. **rotate** - Rotate Images
361
+
362
+ Rotate images by any angle with background color control.
363
+
364
+ **Usage:**
365
+ ```bash
366
+ mediaproc image rotate <input> [options]
367
+ ```
368
+
369
+ **Options:**
370
+ - `-a, --angle <degrees>` - Rotation angle in degrees (default: 90)
371
+ - `--background <color>` - Background color (default: black)
372
+ - `-o, --output <path>` - Output file path
373
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
374
+ - `--dry-run` - Preview without executing
375
+ - `-v, --verbose` - Show detailed output
376
+ - `--help` - Display help
377
+
378
+ **Examples:**
379
+ ```bash
380
+ # Rotate 90° clockwise
381
+ mediaproc image rotate photo.jpg -a 90
382
+
383
+ # Rotate 180° (upside down)
384
+ mediaproc image rotate photo.jpg -a 180
385
+
386
+ # Rotate 45° with white background
387
+ mediaproc image rotate photo.jpg -a 45 --background white
388
+
389
+ # Counter-clockwise rotation
390
+ mediaproc image rotate photo.jpg -a -90
391
+ ```
392
+
393
+ **Common Angles:**
394
+ - **90** - Rotate right (clockwise)
395
+ - **-90 or 270** - Rotate left (counter-clockwise)
396
+ - **180** - Upside down
397
+ - **45** - Diagonal tilt
398
+
399
+ ---
400
+
401
+ ### 7. **flip** - Mirror Images
402
+
403
+ Mirror images horizontally, vertically, or both.
404
+
405
+ **Usage:**
406
+ ```bash
407
+ mediaproc image flip <input> [options]
408
+ ```
409
+
410
+ **Options:**
411
+ - `-d, --direction <direction>` - Direction: horizontal, vertical, both (default: horizontal)
412
+ - `-o, --output <path>` - Output file path
413
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
414
+ - `--dry-run` - Preview without executing
415
+ - `-v, --verbose` - Show detailed output
416
+ - `--help` - Display help
417
+
418
+ **Examples:**
419
+ ```bash
420
+ # Flip horizontally (mirror left-right)
421
+ mediaproc image flip photo.jpg
422
+
423
+ # Flip vertically (mirror up-down)
424
+ mediaproc image flip photo.jpg -d vertical
425
+
426
+ # Flip both ways (180° rotation)
427
+ mediaproc image flip photo.jpg -d both
428
+ ```
429
+
430
+ ---
431
+
432
+ ### 8. **crop** - Extract Regions
433
+
434
+ Extract rectangular regions from images.
435
+
436
+ **Usage:**
437
+ ```bash
438
+ mediaproc image crop <input> [options]
439
+ ```
440
+
441
+ **Options:**
442
+ - `-x <pixels>` - X coordinate (left position, required)
443
+ - `-y <pixels>` - Y coordinate (top position, required)
444
+ - `-w, --width <pixels>` - Crop width (required)
445
+ - `-h, --height <pixels>` - Crop height (required)
446
+ - `-o, --output <path>` - Output file path
447
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
448
+ - `--dry-run` - Preview without executing
449
+ - `-v, --verbose` - Show detailed output
450
+ - `--help` - Display help
451
+
452
+ **Examples:**
453
+ ```bash
454
+ # Crop 800x600 region from top-left (0,0)
455
+ mediaproc image crop photo.jpg -x 0 -y 0 -w 800 -h 600
456
+
457
+ # Crop from specific position
458
+ mediaproc image crop photo.jpg -x 100 -y 50 -w 500 -h 400
459
+
460
+ # Extract center region
461
+ mediaproc image crop photo.jpg -x 400 -y 300 -w 800 -h 600
462
+ ```
463
+
464
+ ---
465
+
466
+ ### 9. **optimize** - Size Optimization
467
+
468
+ Optimize image file size with minimal quality loss.
469
+
470
+ **Usage:**
471
+ ```bash
472
+ mediaproc image optimize <input> [options]
473
+ ```
474
+
475
+ **Options:**
476
+ - `-q, --quality <quality>` - Quality 1-100 (default: 85)
477
+ - `--aggressive` - More aggressive compression (quality 70)
478
+ - `-o, --output <path>` - Output file path
479
+ - `--dry-run` - Preview without executing
480
+ - `-v, --verbose` - Show detailed output
481
+ - `--help` - Display help
482
+
483
+ **Examples:**
484
+ ```bash
485
+ # Optimize with quality 85
486
+ mediaproc image optimize photo.jpg
487
+
488
+ # Light optimization (high quality)
489
+ mediaproc image optimize image.png -q 90
490
+
491
+ # Aggressive compression
492
+ mediaproc image optimize pic.jpg --aggressive
493
+ ```
494
+
495
+ **Quality Guide:**
496
+ - **90-100** - Minimal compression, large files
497
+ - **85-89** - Balanced (recommended for web)
498
+ - **70-84** - Good compression, slight quality loss
499
+ - **50-69** - High compression, noticeable quality loss
500
+
501
+ ---
502
+
503
+ ### 10. **watermark** - Add Watermarks
504
+
505
+ Add watermarks to images with position and opacity control.
506
+
507
+ **Usage:**
508
+ ```bash
509
+ mediaproc image watermark <input> <watermark> [options]
510
+ ```
511
+
512
+ **Options:**
513
+ - `--position <position>` - Position: center, top-left, top-right, bottom-left, bottom-right (default: bottom-right)
514
+ - `--opacity <opacity>` - Opacity 0-1 (default: 0.5)
515
+ - `--scale <scale>` - Watermark scale 0.1-1 (default: 0.2)
516
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
517
+ - `-o, --output <path>` - Output file path
518
+ - `--dry-run` - Preview without executing
519
+ - `-v, --verbose` - Show detailed output
520
+ - `--help` - Display help
521
+
522
+ **Examples:**
523
+ ```bash
524
+ # Add watermark to bottom-right
525
+ mediaproc image watermark photo.jpg logo.png
526
+
527
+ # Center watermark
528
+ mediaproc image watermark image.jpg mark.png --position center
529
+
530
+ # Subtle watermark
531
+ mediaproc image watermark photo.jpg logo.png --opacity 0.3
532
+
533
+ # Larger watermark in top-right
534
+ mediaproc image watermark photo.jpg brand.png --scale 0.3 --position top-right
535
+ ```
536
+
537
+ **Opacity Guide:**
538
+ - **0.1-0.3** - Very subtle
539
+ - **0.4-0.6** - Balanced (recommended)
540
+ - **0.7-0.9** - Clearly visible
541
+ - **1.0** - Fully opaque
542
+
543
+ ---
544
+
545
+ ### 11. **thumbnail** - Generate Thumbnails
546
+
547
+ Generate thumbnails with configurable sizes.
548
+
549
+ **Usage:**
550
+ ```bash
551
+ mediaproc image thumbnail <input> [options]
552
+ ```
553
+
554
+ **Options:**
555
+ - `-s, --size <size>` - Thumbnail size in pixels (default: 150)
556
+ - `--fit <fit>` - Fit mode: cover, contain, fill, inside, outside (default: cover)
557
+ - `-q, --quality <quality>` - Quality 1-100 (default: 85)
558
+ - `-o, --output <path>` - Output file path
559
+ - `--dry-run` - Preview without executing
560
+ - `-v, --verbose` - Show detailed output
561
+ - `--help` - Display help
562
+
563
+ **Examples:**
564
+ ```bash
565
+ # Generate 150x150 thumbnail
566
+ mediaproc image thumbnail photo.jpg
567
+
568
+ # Generate 200x200 thumbnail
569
+ mediaproc image thumbnail image.png -s 200
570
+
571
+ # Thumbnail with padding
572
+ mediaproc image thumbnail pic.jpg -s 100 --fit contain
573
+ ```
574
+
575
+ **Common Sizes:**
576
+ - **64x64** - Favicon, small icons
577
+ - **150x150** - Default thumbnail
578
+ - **200x200** - Medium thumbnails
579
+ - **300x300** - Large thumbnails
580
+ - **512x512** - App icons
581
+
582
+ ---
583
+
584
+ ### 12. **tint** - Apply Color Tint
585
+
586
+ Apply color tint overlay to images.
587
+
588
+ **Usage:**
589
+ ```bash
590
+ mediaproc image tint <input> [options]
591
+ ```
592
+
593
+ **Options:**
594
+ - `-c, --color <color>` - Tint color (hex, rgb, or name, default: #0000ff)
595
+ - `-o, --output <path>` - Output file path
596
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
597
+ - `--dry-run` - Preview without executing
598
+ - `-v, --verbose` - Show detailed output
599
+ - `--help` - Display help
600
+
601
+ **Examples:**
602
+ ```bash
603
+ # Apply blue tint
604
+ mediaproc image tint photo.jpg -c blue
605
+
606
+ # Apply sepia tint
607
+ mediaproc image tint image.png -c "#704214"
608
+
609
+ # Apply custom RGB tint
610
+ mediaproc image tint pic.jpg -c "rgb(255, 100, 50)"
611
+ ```
612
+
613
+ **Common Tints:**
614
+ - **Sepia (#704214)** - Vintage/warm look
615
+ - **Blue (#0066cc)** - Cool/cold mood
616
+ - **Orange (#ff6600)** - Warm/sunset effect
617
+ - **Purple (#9933cc)** - Creative/artistic
618
+ - **Green (#00cc66)** - Nature/fresh feel
619
+
620
+ ---
621
+
622
+ ### 13. **negate** - Create Negative
623
+
624
+ Create negative/inverted images.
625
+
626
+ **Usage:**
627
+ ```bash
628
+ mediaproc image negate <input> [options]
629
+ ```
630
+
631
+ **Options:**
632
+ - `--alpha` - Also negate alpha/transparency channel
633
+ - `-o, --output <path>` - Output file path
634
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
635
+ - `--dry-run` - Preview without executing
636
+ - `-v, --verbose` - Show detailed output
637
+ - `--help` - Display help
638
+
639
+ **Examples:**
640
+ ```bash
641
+ # Create negative
642
+ mediaproc image negate photo.jpg
643
+
644
+ # Negate with alpha channel
645
+ mediaproc image negate image.png --alpha
646
+ ```
647
+
648
+ **Use Cases:**
649
+ - Artistic effects
650
+ - X-ray style images
651
+ - Film negatives
652
+ - High contrast viewing
653
+ - Dark mode alternatives
654
+
655
+ ---
656
+
657
+ ### 14. **normalize** - Enhance Contrast
658
+
659
+ Normalize images by auto-enhancing contrast.
660
+
661
+ **Usage:**
662
+ ```bash
663
+ mediaproc image normalize <input> [options]
664
+ ```
665
+
666
+ **Options:**
667
+ - `-o, --output <path>` - Output file path
668
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
669
+ - `--dry-run` - Preview without executing
670
+ - `-v, --verbose` - Show detailed output
671
+ - `--help` - Display help
672
+
673
+ **Examples:**
674
+ ```bash
675
+ # Auto-enhance contrast
676
+ mediaproc image normalize photo.jpg
677
+
678
+ # Fix underexposed image
679
+ mediaproc image normalize dark-image.png
680
+
681
+ # Fix washed out image
682
+ mediaproc image normalize overexposed.jpg
683
+ ```
684
+
685
+ **Best For:**
686
+ - Underexposed photos
687
+ - Overexposed photos
688
+ - Low contrast images
689
+ - Scanned documents
690
+ - Poor lighting conditions
691
+
692
+ ---
693
+
694
+ ### 15. **modulate** - Adjust Colors
695
+
696
+ Adjust brightness, saturation, and hue.
697
+
698
+ **Usage:**
699
+ ```bash
700
+ mediaproc image modulate <input> [options]
701
+ ```
702
+
703
+ **Options:**
704
+ - `-b, --brightness <value>` - Brightness multiplier 0.1-10 (default: 1)
705
+ - `-s, --saturation <value>` - Saturation multiplier 0.1-10 (default: 1)
706
+ - `--hue <degrees>` - Hue rotation -360 to 360 (default: 0)
707
+ - `-o, --output <path>` - Output file path
708
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
709
+ - `--dry-run` - Preview without executing
710
+ - `-v, --verbose` - Show detailed output
711
+ - `--help` - Display help
712
+
713
+ **Examples:**
714
+ ```bash
715
+ # Increase brightness by 20%
716
+ mediaproc image modulate photo.jpg -b 1.2
717
+
718
+ # Boost saturation by 50%
719
+ mediaproc image modulate image.png -s 1.5
720
+
721
+ # Rotate hue by 180 degrees
722
+ mediaproc image modulate pic.jpg --hue 180
723
+
724
+ # Adjust all three
725
+ mediaproc image modulate photo.jpg -b 1.2 -s 1.3 --hue 30
726
+ ```
727
+
728
+ **Brightness:**
729
+ - **0.5** - 50% darker
730
+ - **1.0** - No change (default)
731
+ - **1.5** - 50% brighter
732
+ - **2.0** - Double brightness
733
+
734
+ **Saturation:**
735
+ - **0.0** - Grayscale
736
+ - **1.0** - No change (default)
737
+ - **1.5** - 50% more vibrant
738
+ - **2.0** - Double saturation
739
+
740
+ ---
741
+
742
+ ### 16. **gamma** - Gamma Correction
743
+
744
+ Apply gamma correction to adjust midtones.
745
+
746
+ **Usage:**
747
+ ```bash
748
+ mediaproc image gamma <input> [options]
749
+ ```
750
+
751
+ **Options:**
752
+ - `-g, --gamma <value>` - Gamma value 1-3 (default: 2.2)
753
+ - `--gamma-out <value>` - Output gamma value (optional)
754
+ - `-o, --output <path>` - Output file path
755
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
756
+ - `--dry-run` - Preview without executing
757
+ - `-v, --verbose` - Show detailed output
758
+ - `--help` - Display help
759
+
760
+ **Examples:**
761
+ ```bash
762
+ # Standard sRGB gamma
763
+ mediaproc image gamma photo.jpg -g 2.2
764
+
765
+ # Brighten midtones
766
+ mediaproc image gamma image.png -g 1.5
767
+
768
+ # Darken midtones
769
+ mediaproc image gamma pic.jpg -g 2.8
770
+ ```
771
+
772
+ **Gamma Values:**
773
+ - **1.0** - Linear (no correction)
774
+ - **1.5** - Lighter midtones
775
+ - **2.2** - Standard sRGB
776
+ - **2.4** - Rec. 709 (video)
777
+ - **2.8** - Darker midtones
778
+
779
+ ---
780
+
781
+ ### 17. **trim** - Remove Borders
782
+
783
+ Auto-trim/remove border edges from images.
784
+
785
+ **Usage:**
786
+ ```bash
787
+ mediaproc image trim <input> [options]
788
+ ```
789
+
790
+ **Options:**
791
+ - `-t, --threshold <value>` - Edge detection threshold 1-100 (default: 10)
792
+ - `-o, --output <path>` - Output file path
793
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
794
+ - `--dry-run` - Preview without executing
795
+ - `-v, --verbose` - Show detailed output
796
+ - `--help` - Display help
797
+
798
+ **Examples:**
799
+ ```bash
800
+ # Auto-trim with default threshold
801
+ mediaproc image trim photo.jpg
802
+
803
+ # Gentle trim
804
+ mediaproc image trim image.png -t 5
805
+
806
+ # Aggressive trim
807
+ mediaproc image trim pic.jpg -t 20
808
+ ```
809
+
810
+ **Threshold Guide:**
811
+ - **1-5** - Very sensitive
812
+ - **10** - Default (balanced)
813
+ - **15-25** - Aggressive
814
+ - **25+** - Very aggressive
815
+
816
+ **Best For:**
817
+ - Scanned documents
818
+ - Screenshots
819
+ - Solid color borders
820
+ - Product photos
821
+ - Auto-cropping
822
+
823
+ ---
824
+
825
+ ### 18. **extend** - Add Padding
826
+
827
+ Add padding/borders around images.
828
+
829
+ **Usage:**
830
+ ```bash
831
+ mediaproc image extend <input> [options]
832
+ ```
833
+
834
+ **Options:**
835
+ - `--all <pixels>` - Padding on all sides (shortcut)
836
+ - `--top <pixels>` - Top padding
837
+ - `--bottom <pixels>` - Bottom padding
838
+ - `--left <pixels>` - Left padding
839
+ - `--right <pixels>` - Right padding
840
+ - `--background <color>` - Background color (default: white)
841
+ - `-o, --output <path>` - Output file path
842
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
843
+ - `--dry-run` - Preview without executing
844
+ - `-v, --verbose` - Show detailed output
845
+ - `--help` - Display help
846
+
847
+ **Examples:**
848
+ ```bash
849
+ # Add 50px padding on all sides
850
+ mediaproc image extend photo.jpg --all 50
851
+
852
+ # Add black border
853
+ mediaproc image extend image.png --all 20 --background black
854
+
855
+ # Add padding top/bottom only
856
+ mediaproc image extend pic.jpg --top 100 --bottom 100
857
+
858
+ # Custom color border
859
+ mediaproc image extend photo.jpg --all 30 --background "#ff0000"
860
+ ```
861
+
862
+ **Use Cases:**
863
+ - Adding borders/frames
864
+ - Letterbox/pillarbox effect
865
+ - Preparing for specific dimensions
866
+ - Space for text overlay
867
+ - Social media formatting
868
+
869
+ ---
870
+
871
+ ### 19. **median** - Noise Reduction
872
+
873
+ Apply median filter for noise reduction.
874
+
875
+ **Usage:**
876
+ ```bash
877
+ mediaproc image median <input> [options]
878
+ ```
879
+
880
+ **Options:**
881
+ - `-s, --size <size>` - Filter size 1-50 (default: 3)
882
+ - `-o, --output <path>` - Output file path
883
+ - `-q, --quality <quality>` - Quality 1-100 (default: 90)
884
+ - `--dry-run` - Preview without executing
885
+ - `-v, --verbose` - Show detailed output
886
+ - `--help` - Display help
887
+
888
+ **Examples:**
889
+ ```bash
890
+ # Default median filter
891
+ mediaproc image median photo.jpg
892
+
893
+ # Stronger noise reduction
894
+ mediaproc image median noisy-image.png -s 5
895
+
896
+ # Remove scanner artifacts
897
+ mediaproc image median scan.jpg -s 7
898
+ ```
899
+
900
+ **Filter Size:**
901
+ - **1** - Minimal smoothing
902
+ - **3** - Default (balanced)
903
+ - **5-7** - Strong noise reduction
904
+ - **10+** - Heavy smoothing
905
+
906
+ **Best For:**
907
+ - Salt-and-pepper noise
908
+ - Scanner artifacts
909
+ - JPEG compression noise
910
+ - Old photo restoration
911
+ - Low-light camera noise
912
+
913
+ ---
914
+
915
+ ### 20. **composite** - Layer Images
916
+
917
+ Composite/blend multiple images together with various blend modes and positioning.
918
+
919
+ **Usage:**
920
+ ```bash
921
+ mediaproc image composite <base> <overlay> [options]
922
+ ```
923
+
924
+ **Options:**
925
+ - `--blend <mode>` - Blend mode: over, add, multiply, screen, overlay (default: over)
926
+ - `--gravity <position>` - Position: center, north, south, east, west, northeast, northwest, southeast, southwest (default: center)
927
+ - `--opacity <value>` - Overlay opacity 0-1 (default: 1)
928
+ - `-x <pixels>` - X offset from gravity position
929
+ - `-y <pixels>` - Y offset from gravity position
930
+ - `-o, --output <path>` - Output file path
931
+ - `--dry-run` - Preview without executing
932
+ - `-v, --verbose` - Show detailed output
933
+
934
+ **Examples:**
935
+ ```bash
936
+ # Overlay image on top
937
+ mediaproc image composite base.jpg overlay.png
938
+
939
+ # Blend with multiply mode
940
+ mediaproc image composite photo.jpg texture.jpg --blend multiply
941
+
942
+ # Position in top-right with opacity
943
+ mediaproc image composite bg.jpg logo.png --gravity northeast --opacity 0.7
944
+
945
+ # Precise positioning
946
+ mediaproc image composite base.jpg watermark.png -x 50 -y 50
947
+ ```
948
+
949
+ **Blend Modes:**
950
+ - **over** - Normal overlay (default)
951
+ - **add** - Additive blend
952
+ - **multiply** - Darken blend
953
+ - **screen** - Lighten blend
954
+ - **overlay** - Enhanced contrast blend
955
+
956
+ ---
957
+
958
+ ### 21. **extract** - Extract Channels
959
+
960
+ Extract specific color channels or regions from images.
961
+
962
+ **Usage:**
963
+ ```bash
964
+ mediaproc image extract <input> [options]
965
+ ```
966
+
967
+ **Options:**
968
+ - `--channel <channel>` - Channel: red, green, blue, alpha (default: red)
969
+ - `-o, --output <path>` - Output file path
970
+ - `--dry-run` - Preview without executing
971
+ - `-v, --verbose` - Show detailed output
972
+
973
+ **Examples:**
974
+ ```bash
975
+ # Extract red channel
976
+ mediaproc image extract photo.jpg --channel red
977
+
978
+ # Extract alpha channel (transparency)
979
+ mediaproc image extract image.png --channel alpha
980
+
981
+ # Extract green channel
982
+ mediaproc image extract pic.jpg --channel green -o green-channel.jpg
983
+ ```
984
+
985
+ **Use Cases:**
986
+ - Channel analysis
987
+ - Alpha mask extraction
988
+ - Color correction workflows
989
+ - Special effects
990
+ - Debugging image issues
991
+
992
+ ---
993
+
994
+ ### 22. **border** - Add Decorative Borders
995
+
996
+ Add colored borders/frames around images.
997
+
998
+ **Usage:**
999
+ ```bash
1000
+ mediaproc image border <input> [options]
1001
+ ```
1002
+
1003
+ **Options:**
1004
+ - `-w, --width <pixels>` - Border width (default: 10)
1005
+ - `-c, --color <color>` - Border color (default: black)
1006
+ - `-o, --output <path>` - Output file path
1007
+ - `--dry-run` - Preview without executing
1008
+ - `-v, --verbose` - Show detailed output
1009
+
1010
+ **Examples:**
1011
+ ```bash
1012
+ # Default black border
1013
+ mediaproc image border photo.jpg
1014
+
1015
+ # White border
1016
+ mediaproc image border image.png -w 20 -c white
1017
+
1018
+ # Custom color border
1019
+ mediaproc image border pic.jpg -w 15 -c "#ff6600"
1020
+
1021
+ # Instagram-style border
1022
+ mediaproc image border photo.jpg -w 30 -c "#f0f0f0"
1023
+ ```
1024
+
1025
+ **Popular Border Styles:**
1026
+ - **Black 10px** - Classic frame
1027
+ - **White 20-30px** - Instagram style
1028
+ - **Gray 5px** - Subtle separation
1029
+ - **Colored borders** - Branding/themes
1030
+
1031
+ ---
1032
+
1033
+ ### 23. **stats** - Image Information
1034
+
1035
+ Display detailed technical information about images.
1036
+
1037
+ **Usage:**
1038
+ ```bash
1039
+ mediaproc image stats <input> [options]
1040
+ ```
1041
+
1042
+ **Options:**
1043
+ - `-v, --verbose` - Show extended metadata and channel statistics
1044
+ - `--help` - Display help
1045
+
1046
+ **Examples:**
1047
+ ```bash
1048
+ # Basic stats
1049
+ mediaproc image stats photo.jpg
1050
+
1051
+ # Detailed analysis
1052
+ mediaproc image stats image.png -v
1053
+ ```
1054
+
1055
+ **Information Displayed:**
1056
+ - Format and dimensions
1057
+ - Color space and channels
1058
+ - File size and compression
1059
+ - DPI/density
1060
+ - Bit depth
1061
+ - EXIF metadata (if present)
1062
+ - Color profile information
1063
+ - Channel statistics (with -v)
1064
+
1065
+ **Use Cases:**
1066
+ - Pre-processing analysis
1067
+ - Quality verification
1068
+ - Format identification
1069
+ - Troubleshooting
1070
+ - Metadata inspection
1071
+
1072
+ ---
1073
+
1074
+ ### 24. **sepia** - Vintage Sepia Tone
1075
+
1076
+ Apply vintage sepia tone effect for classic photography look.
1077
+
1078
+ **Usage:**
1079
+ ```bash
1080
+ mediaproc image sepia <input> [options]
1081
+ ```
1082
+
1083
+ **Options:**
1084
+ - `-i, --intensity <value>` - Sepia intensity 0-100 (default: 80)
1085
+ - `-o, --output <path>` - Output file path
1086
+ - `--dry-run` - Preview without executing
1087
+ - `-v, --verbose` - Show detailed output
1088
+
1089
+ **Examples:**
1090
+ ```bash
1091
+ # Classic sepia
1092
+ mediaproc image sepia photo.jpg
1093
+
1094
+ # Strong vintage effect
1095
+ mediaproc image sepia old-photo.png -i 100
1096
+
1097
+ # Subtle warmth
1098
+ mediaproc image sepia modern.jpg -i 40
1099
+ ```
1100
+
1101
+ **Intensity Guide:**
1102
+ - **20-40** - Subtle warm tint
1103
+ - **60-80** - Classic sepia (recommended)
1104
+ - **80-100** - Strong vintage effect
1105
+
1106
+ ---
1107
+
1108
+ ### 25. **clahe** - Contrast Enhancement
1109
+
1110
+ Apply Contrast Limited Adaptive Histogram Equalization for advanced contrast enhancement.
1111
+
1112
+ **Usage:**
1113
+ ```bash
1114
+ mediaproc image clahe <input> [options]
1115
+ ```
1116
+
1117
+ **Options:**
1118
+ - `-w, --width <pixels>` - Region width (default: 8)
1119
+ - `-h, --height <pixels>` - Region height (default: 8)
1120
+ - `--max-slope <value>` - Maximum contrast slope 0-100 (default: 2.5)
1121
+ - `-o, --output <path>` - Output file path
1122
+ - `--dry-run` - Preview without executing
1123
+ - `-v, --verbose` - Show detailed output
1124
+
1125
+ **Examples:**
1126
+ ```bash
1127
+ # Default CLAHE
1128
+ mediaproc image clahe photo.jpg
1129
+
1130
+ # Strong enhancement
1131
+ mediaproc image clahe underexposed.jpg --max-slope 4
1132
+
1133
+ # Fine-grained adjustment
1134
+ mediaproc image clahe medical.png -w 16 -h 16
1135
+ ```
1136
+
1137
+ **Best For:**
1138
+ - Medical imaging
1139
+ - Scientific photography
1140
+ - Underwater photos
1141
+ - Low-light images
1142
+ - X-ray enhancement
1143
+
1144
+ ---
1145
+
1146
+ ### 26. **convolve** - Custom Kernel Filters
1147
+
1148
+ Apply custom convolution kernels for advanced image filtering.
1149
+
1150
+ **Usage:**
1151
+ ```bash
1152
+ mediaproc image convolve <input> [options]
1153
+ ```
1154
+
1155
+ **Options:**
1156
+ - `-k, --kernel <name>` - Preset kernel: sharpen, emboss, edge-detect, box-blur, gaussian-blur, laplacian, high-pass
1157
+ - `-o, --output <path>` - Output file path
1158
+ - `--dry-run` - Preview without executing
1159
+ - `-v, --verbose` - Show detailed output
1160
+
1161
+ **Examples:**
1162
+ ```bash
1163
+ # Edge detection
1164
+ mediaproc image convolve photo.jpg -k edge-detect
1165
+
1166
+ # Emboss effect
1167
+ mediaproc image convolve image.png -k emboss
1168
+
1169
+ # High-pass filter
1170
+ mediaproc image convolve pic.jpg -k high-pass
1171
+ ```
1172
+
1173
+ **Preset Kernels:**
1174
+ - **sharpen** - Enhance edges
1175
+ - **emboss** - 3D relief effect
1176
+ - **edge-detect** - Detect edges
1177
+ - **box-blur** - Simple blur
1178
+ - **gaussian-blur** - Smooth blur
1179
+ - **laplacian** - Edge enhancement
1180
+ - **high-pass** - Detail extraction
1181
+
1182
+ ---
1183
+
1184
+ ### 27. **vignette** - Darken Edges
1185
+
1186
+ Add vignette effect (darkened edges) for artistic focus.
1187
+
1188
+ **Usage:**
1189
+ ```bash
1190
+ mediaproc image vignette <input> [options]
1191
+ ```
1192
+
1193
+ **Options:**
1194
+ - `-i, --intensity <value>` - Vignette intensity 0-100 (default: 50)
1195
+ - `-o, --output <path>` - Output file path
1196
+ - `--dry-run` - Preview without executing
1197
+ - `-v, --verbose` - Show detailed output
1198
+
1199
+ **Examples:**
1200
+ ```bash
1201
+ # Default vignette
1202
+ mediaproc image vignette photo.jpg
1203
+
1204
+ # Subtle vignette
1205
+ mediaproc image vignette portrait.png -i 30
1206
+
1207
+ # Strong dramatic effect
1208
+ mediaproc image vignette landscape.jpg -i 80
1209
+ ```
1210
+
1211
+ **Intensity Guide:**
1212
+ - **20-40** - Subtle focus
1213
+ - **40-60** - Balanced (recommended)
1214
+ - **60-80** - Dramatic effect
1215
+ - **80-100** - Heavy darkening
1216
+
1217
+ ---
1218
+
1219
+ ## 🔧 Global Options
1220
+
1221
+ All commands support these global options:
1222
+
1223
+ - `-o, --output <path>` - Custom output file path
1224
+ - `-q, --quality <quality>` - Output quality (1-100)
1225
+ - `--dry-run` - Preview changes without executing
1226
+ - `-v, --verbose` - Show detailed processing information
1227
+ - `--help` - Display command-specific help
1228
+
1229
+ ## 💡 Usage Tips
1230
+
1231
+ ### Quality Settings
1232
+ - **90-100**: Maximum quality, larger files
1233
+ - **85-90**: Recommended for web (best balance)
1234
+ - **70-85**: Good compression, slight quality loss
1235
+ - **Below 70**: High compression, noticeable quality loss
1236
+
1237
+ ### File Formats
1238
+ - **WebP**: Best for web, 25-35% smaller than JPG/PNG
1239
+ - **AVIF**: Newest format, smaller than WebP
1240
+ - **JPG**: Best for photos
1241
+ - **PNG**: Best for graphics with transparency
1242
+
1243
+ ### Batch Processing
1244
+ ```bash
1245
+ # Process multiple files
1246
+ for file in *.jpg; do
1247
+ mediaproc image resize "$file" -w 1920 -h 1080
1248
+ done
1249
+
1250
+ # Convert all images to WebP
1251
+ for file in *.{jpg,png}; do
1252
+ mediaproc image convert "$file" -f webp -q 85
1253
+ done
1254
+ ```
1255
+
1256
+ ### Chaining Commands
1257
+ Use dry-run to test, then execute:
1258
+ ```bash
1259
+ # Test first
1260
+ mediaproc image resize photo.jpg -w 800 --dry-run
1261
+
1262
+ # Then execute
1263
+ mediaproc image resize photo.jpg -w 800
1264
+ ```
1265
+
1266
+ ## 🚀 Performance
1267
+
1268
+ - Built on libvips for high performance
1269
+ - Processes 4-5x faster than ImageMagick
1270
+ - Low memory footprint
1271
+ - Efficient multi-threading
1272
+ - Optimized for batch processing
1273
+
1274
+ ## 📝 Examples
1275
+
1276
+ ### Web Optimization Workflow
1277
+ ```bash
1278
+ # 1. Resize for web
1279
+ mediaproc image resize photo.jpg -w 1920 -h 1080
1280
+
1281
+ # 2. Optimize
1282
+ mediaproc image optimize photo-1920x1080.jpg -q 85
1283
+
1284
+ # 3. Convert to WebP
1285
+ mediaproc image convert photo-1920x1080-optimized.jpg -f webp
1286
+ ```
1287
+
1288
+ ### Photo Enhancement Workflow
1289
+ ```bash
1290
+ # 1. Normalize contrast
1291
+ mediaproc image normalize photo.jpg
1292
+
1293
+ # 2. Adjust colors
1294
+ mediaproc image modulate photo-normalized.jpg -b 1.1 -s 1.2
1295
+
1296
+ # 3. Sharpen
1297
+ mediaproc image sharpen photo-normalized-modulated.jpg -s 1.5
1298
+ ```
1299
+
1300
+ ### Thumbnail Generation
1301
+ ```bash
1302
+ # Generate multiple sizes
1303
+ mediaproc image thumbnail photo.jpg -s 64 -o thumb-64.jpg
1304
+ mediaproc image thumbnail photo.jpg -s 150 -o thumb-150.jpg
1305
+ mediaproc image thumbnail photo.jpg -s 300 -o thumb-300.jpg
1306
+ ```
1307
+
1308
+ ---
1309
+
1310
+ ## 🤖 Custom/Smart Commands
1311
+
1312
+ ### **batch** - Bulk Image Processing
1313
+
1314
+ Process multiple images in a directory with any operation.
1315
+
1316
+ **Usage:**
1317
+ ```bash
1318
+ mediaproc image batch <directory> --operation <operation> [options]
1319
+ ```
1320
+
1321
+ **Options:**
1322
+ - `-op, --operation <operation>` - Operation to apply: resize, convert, optimize, grayscale, etc. (required)
1323
+ - `-o, --output <directory>` - Output directory (default: ./output)
1324
+ - `-r, --recursive` - Process subdirectories
1325
+ - `--width <pixels>` - Width for resize
1326
+ - `--height <pixels>` - Height for resize
1327
+ - `-f, --format <format>` - Output format for convert
1328
+ - `-q, --quality <quality>` - Quality setting
1329
+
1330
+ **Examples:**
1331
+ ```bash
1332
+ # Resize all images
1333
+ mediaproc image batch ./photos --operation resize --width 1920
1334
+
1335
+ # Convert all to WebP
1336
+ mediaproc image batch ./images -op convert --format webp -q 90
1337
+
1338
+ # Optimize all images
1339
+ mediaproc image batch ./pics -op optimize -q 85 -o ./optimized
1340
+
1341
+ # Generate thumbnails
1342
+ mediaproc image batch ./gallery -op thumbnail --width 200 --height 200
1343
+ ```
1344
+
1345
+ **Supported Operations:** resize, convert, optimize, grayscale, blur, sharpen, thumbnail, sepia, normalize
1346
+
1347
+ ---
1348
+
1349
+ ### **smart-crop** - Intelligent Content-Aware Cropping
1350
+
1351
+ Automatically crop to target dimensions while preserving important content.
1352
+
1353
+ **Usage:**
1354
+ ```bash
1355
+ mediaproc image smart-crop <input> -w <width> -h <height> [options]
1356
+ ```
1357
+
1358
+ **Options:**
1359
+ - `-w, --width <pixels>` - Target width (required)
1360
+ - `-h, --height <pixels>` - Target height (required)
1361
+ - `-s, --strategy <type>` - Strategy: entropy (edges/details) or attention (center-weighted) (default: entropy)
1362
+ - `-o, --output <path>` - Output file path
1363
+
1364
+ **Examples:**
1365
+ ```bash
1366
+ # Social media banner
1367
+ mediaproc image smart-crop photo.jpg -w 1200 -h 630
1368
+
1369
+ # Square crop for Instagram
1370
+ mediaproc image smart-crop portrait.jpg -w 800 -h 800 --strategy attention
1371
+
1372
+ # Product thumbnail
1373
+ mediaproc image smart-crop product.png -w 600 -h 600 -o thumbnail.png
1374
+ ```
1375
+
1376
+ **Common Dimensions:**
1377
+ - `1200x630` - Facebook/LinkedIn posts
1378
+ - `1024x512` - Twitter cards
1379
+ - `1080x1080` - Instagram square
1380
+ - `800x800` - General thumbnails
1381
+
1382
+ ---
1383
+
1384
+ ### **pixelate** - Retro Pixel Art Effect
1385
+
1386
+ Apply pixelate/mosaic effect for artistic or privacy purposes.
1387
+
1388
+ **Usage:**
1389
+ ```bash
1390
+ mediaproc image pixelate <input> [options]
1391
+ ```
1392
+
1393
+ **Options:**
1394
+ - `-p, --pixels <size>` - Pixel size 2-50 (default: 10) - larger = more pixelated
1395
+ - `-o, --output <path>` - Output file path
1396
+
1397
+ **Examples:**
1398
+ ```bash
1399
+ # Default pixelation
1400
+ mediaproc image pixelate photo.jpg
1401
+
1402
+ # Heavy pixelation for privacy
1403
+ mediaproc image pixelate face.jpg --pixels 20
1404
+
1405
+ # 8-bit retro gaming style
1406
+ mediaproc image pixelate game.jpg --pixels 8 -o retro.jpg
1407
+ ```
1408
+
1409
+ **Use Cases:**
1410
+ - Retro gaming aesthetics (8-12 pixel size)
1411
+ - Privacy protection (15-25 pixel size)
1412
+ - Artistic effects
1413
+ - Censorship/redaction
1414
+
1415
+ ---
1416
+
1417
+ ### **palette** - Color Palette Extraction
1418
+
1419
+ Extract and display dominant colors from images.
1420
+
1421
+ **Usage:**
1422
+ ```bash
1423
+ mediaproc image palette <input> [options]
1424
+ ```
1425
+
1426
+ **Options:**
1427
+ - `-c, --colors <count>` - Number of colors 1-10 (default: 5)
1428
+ - `-v, --verbose` - Show hex codes and RGB values
1429
+
1430
+ **Examples:**
1431
+ ```bash
1432
+ # Extract 5 dominant colors
1433
+ mediaproc image palette photo.jpg
1434
+
1435
+ # Get brand colors
1436
+ mediaproc image palette logo.png --colors 3 -v
1437
+
1438
+ # Full palette analysis
1439
+ mediaproc image palette artwork.jpg --colors 10
1440
+ ```
1441
+
1442
+ **Output Includes:**
1443
+ - Dominant colors ranked by prevalence
1444
+ - RGB and hex values
1445
+ - Color temperature (warm/cool)
1446
+ - Brightness analysis
1447
+ - Saturation levels
1448
+
1449
+ **Use Cases:**
1450
+ - Design inspiration
1451
+ - Brand color extraction
1452
+ - Theme generation
1453
+ - UI/UX color matching
1454
+
1455
+ ---
1456
+
1457
+ ### 28. **smart-crop** - Intelligent Content-Aware Cropping
1458
+
1459
+ Automatically crop to target dimensions while preserving important content using edge detection.
1460
+
1461
+ **Usage:**
1462
+ ```bash
1463
+ mediaproc image smart-crop <input> -w <width> -h <height> [options]
1464
+ ```
1465
+
1466
+ **Options:**
1467
+ - `-w, --width <pixels>` - Target width (required)
1468
+ - `-h, --height <pixels>` - Target height (required)
1469
+ - `-s, --strategy <type>` - Strategy: entropy (edges/details) or attention (center-weighted) (default: entropy)
1470
+ - `-o, --output <path>` - Output file path
1471
+ - `--dry-run` - Preview without executing
1472
+ - `-v, --verbose` - Show detailed output
1473
+
1474
+ **Examples:**
1475
+ ```bash
1476
+ # Social media banner
1477
+ mediaproc image smart-crop photo.jpg -w 1200 -h 630
1478
+
1479
+ # Square crop for Instagram
1480
+ mediaproc image smart-crop portrait.jpg -w 800 -h 800 --strategy attention
1481
+
1482
+ # Product thumbnail
1483
+ mediaproc image smart-crop product.png -w 600 -h 600
1484
+ ```
1485
+
1486
+ **Strategies:**
1487
+ - **entropy** - Focus on edges and details (best for landscapes)
1488
+ - **attention** - Center-weighted (best for portraits)
1489
+
1490
+ **Common Social Media Dimensions:**
1491
+ - **1200x630** - Facebook/LinkedIn posts
1492
+ - **1024x512** - Twitter cards
1493
+ - **1080x1080** - Instagram square
1494
+ - **1080x1350** - Instagram portrait
1495
+ - **800x800** - General thumbnails
1496
+
1497
+ ---
1498
+
1499
+ ### 29. **pixelate** - Retro Pixel Art Effect
1500
+
1501
+ Apply pixelate/mosaic effect for artistic or privacy purposes.
1502
+
1503
+ **Usage:**
1504
+ ```bash
1505
+ mediaproc image pixelate <input> [options]
1506
+ ```
1507
+
1508
+ **Options:**
1509
+ - `-p, --pixels <size>` - Pixel size 2-50 (default: 10) - larger = more pixelated
1510
+ - `-o, --output <path>` - Output file path
1511
+ - `--dry-run` - Preview without executing
1512
+ - `-v, --verbose` - Show detailed output
1513
+
1514
+ **Examples:**
1515
+ ```bash
1516
+ # Default pixelation
1517
+ mediaproc image pixelate photo.jpg
1518
+
1519
+ # Heavy pixelation for privacy
1520
+ mediaproc image pixelate face.jpg --pixels 20
1521
+
1522
+ # 8-bit retro gaming style
1523
+ mediaproc image pixelate game.jpg --pixels 8
1524
+ ```
1525
+
1526
+ **Pixel Size Guide:**
1527
+ - **2-5** - Subtle texture
1528
+ - **8-12** - Retro gaming aesthetics
1529
+ - **15-25** - Privacy protection
1530
+ - **30+** - Abstract art
1531
+
1532
+ ---
1533
+
1534
+ ### 30. **palette** - Color Palette Extraction
1535
+
1536
+ Extract and display dominant colors with detailed analysis.
1537
+
1538
+ **Usage:**
1539
+ ```bash
1540
+ mediaproc image palette <input> [options]
1541
+ ```
1542
+
1543
+ **Options:**
1544
+ - `-c, --colors <count>` - Number of colors 1-10 (default: 5)
1545
+ - `-v, --verbose` - Show hex codes and RGB values
1546
+ - `--help` - Display help
1547
+
1548
+ **Examples:**
1549
+ ```bash
1550
+ # Extract 5 dominant colors
1551
+ mediaproc image palette photo.jpg
1552
+
1553
+ # Get brand colors
1554
+ mediaproc image palette logo.png --colors 3 -v
1555
+
1556
+ # Full palette analysis
1557
+ mediaproc image palette artwork.jpg --colors 10
1558
+ ```
1559
+
1560
+ **Output Includes:**
1561
+ - Dominant colors ranked by prevalence
1562
+ - RGB and hex values
1563
+ - Color temperature (warm/cool)
1564
+ - Brightness analysis
1565
+ - Saturation levels
1566
+ - Channel statistics
1567
+
1568
+ ---
1569
+
1570
+ ### 31. **batch** - Bulk Image Processing
1571
+
1572
+ Process multiple images in a directory with any supported operation.
1573
+
1574
+ **Usage:**
1575
+ ```bash
1576
+ mediaproc image batch <directory> --operation <operation> [options]
1577
+ ```
1578
+
1579
+ **Options:**
1580
+ - `-op, --operation <operation>` - Operation: resize, convert, optimize, grayscale, etc. (required)
1581
+ - `-o, --output <directory>` - Output directory (default: ./output)
1582
+ - `-r, --recursive` - Process subdirectories
1583
+ - `--width <pixels>` - Width for resize operations
1584
+ - `--height <pixels>` - Height for resize operations
1585
+ - `-f, --format <format>` - Output format for convert
1586
+ - `-q, --quality <quality>` - Quality setting 1-100
1587
+ - `--dry-run` - Preview without executing
1588
+ - `-v, --verbose` - Show detailed output
1589
+
1590
+ **Examples:**
1591
+ ```bash
1592
+ # Resize all images
1593
+ mediaproc image batch ./photos --operation resize --width 1920
1594
+
1595
+ # Convert all to WebP
1596
+ mediaproc image batch ./images -op convert --format webp -q 90
1597
+
1598
+ # Optimize all recursively
1599
+ mediaproc image batch ./pics -op optimize -q 85 -o ./optimized -r
1600
+
1601
+ # Generate thumbnails
1602
+ mediaproc image batch ./gallery -op thumbnail --width 200
1603
+ ```
1604
+
1605
+ **Supported Operations:**
1606
+ resize, convert, optimize, grayscale, blur, sharpen, thumbnail, sepia, normalize, modulate, rotate, flip
1607
+
1608
+ ---
1609
+
1610
+ ### 32. **auto-enhance** - Automatic Image Enhancement
1611
+
1612
+ Intelligently enhance images with automatic color, contrast, and sharpness adjustments.
1613
+
1614
+ **Usage:**
1615
+ ```bash
1616
+ mediaproc image auto-enhance <input> [options]
1617
+ ```
1618
+
1619
+ **Options:**
1620
+ - `-l, --level <level>` - Enhancement level: low, medium, high (default: medium)
1621
+ - `-o, --output <path>` - Output file path
1622
+ - `--dry-run` - Preview without executing
1623
+ - `-v, --verbose` - Show detailed output
1624
+
1625
+ **Enhancement Levels:**
1626
+ - **low** - Normalize + Light sharpen (subtle, ~10% improvement)
1627
+ - **medium** - Normalize + Color boost + Sharpen (balanced, ~30% improvement)
1628
+ - **high** - Normalize + CLAHE + Strong color boost + Heavy sharpen (aggressive, ~50% improvement)
1629
+
1630
+ **Examples:**
1631
+ ```bash
1632
+ # Default enhancement
1633
+ mediaproc image auto-enhance photo.jpg
1634
+
1635
+ # Strong enhancement for dark images
1636
+ mediaproc image auto-enhance dark.jpg --level high
1637
+
1638
+ # Subtle enhancement
1639
+ mediaproc image auto-enhance good-photo.jpg -l low
1640
+ ```
1641
+
1642
+ **What Gets Enhanced:**
1643
+ - ✅ Color normalization and balance
1644
+ - ✅ Contrast enhancement (CLAHE for high level)
1645
+ - ✅ Sharpness and clarity
1646
+ - ✅ Brightness optimization
1647
+ - ✅ Saturation boost
1648
+ - ✅ Detail preservation
1649
+
1650
+ **Best For:**
1651
+ - Quick photo fixes
1652
+ - Batch photo processing
1653
+ - Underexposed images
1654
+ - Low-contrast photos
1655
+ - Dull/flat images
1656
+
1657
+ ---
1658
+
1659
+ ### **auto-enhance** - Automatic Image Enhancement
1660
+
1661
+ Intelligently enhance images with one command.
1662
+
1663
+ **Usage:**
1664
+ ```bash
1665
+ mediaproc image auto-enhance <input> [options]
1666
+ ```
1667
+
1668
+ **Options:**
1669
+ - `-l, --level <level>` - Enhancement level: low, medium, high (default: medium)
1670
+ - `-o, --output <path>` - Output file path
1671
+
1672
+ **Enhancement Levels:**
1673
+ - **low** - Normalize + Light sharpen (subtle)
1674
+ - **medium** - Normalize + Color boost + Sharpen (recommended)
1675
+ - **high** - Normalize + CLAHE + Strong color boost + Heavy sharpen (aggressive)
1676
+
1677
+ **Examples:**
1678
+ ```bash
1679
+ # Default enhancement
1680
+ mediaproc image auto-enhance photo.jpg
1681
+
1682
+ # Strong enhancement for dark images
1683
+ mediaproc image auto-enhance dark.jpg --level high
1684
+
1685
+ # Subtle enhancement
1686
+ mediaproc image auto-enhance good-photo.jpg -l low
1687
+ ```
1688
+
1689
+ **What Gets Enhanced:**
1690
+ - Color normalization
1691
+ - Sharpness
1692
+ - Contrast
1693
+ - Brightness
1694
+ - Clarity
1695
+ - Detail preservation
1696
+
1697
+ ---
1698
+
1699
+ ### 39. **grid** - Create Image Collages
1700
+
1701
+ Combine multiple images into professional grid/collage layouts with full control over spacing, sizing, and background.
1702
+
1703
+ **Usage:**
1704
+ ```bash
1705
+ mediaproc image grid <images...> [options]
1706
+ ```
1707
+
1708
+ **Options:**
1709
+ - `-c, --columns <number>` - Number of columns (auto-calculated if not specified)
1710
+ - `-r, --rows <number>` - Number of rows (auto-calculated if not specified)
1711
+ - `-w, --width <pixels>` - Width of each cell (default: 300)
1712
+ - `-h, --height <pixels>` - Height of each cell (default: 300)
1713
+ - `-g, --gap <pixels>` - Gap between images in pixels (default: 10)
1714
+ - `-b, --background <color>` - Background color (default: white)
1715
+ - `-o, --output <path>` - Output file path (default: grid.png)
1716
+ - `--dry-run` - Preview without executing
1717
+ - `-v, --verbose` - Show detailed output
1718
+
1719
+ **Examples:**
1720
+ ```bash
1721
+ # Auto 2x2 grid
1722
+ mediaproc image grid img1.jpg img2.jpg img3.jpg img4.jpg
1723
+
1724
+ # 3-column layout (auto rows)
1725
+ mediaproc image grid photos/*.jpg -c 3 -w 400 -h 400
1726
+
1727
+ # Instagram multi-post (3x3 square grid)
1728
+ mediaproc image grid *.png -c 3 -w 400 -h 400 -g 0 -o instagram.jpg
1729
+
1730
+ # Photo album with spacing
1731
+ mediaproc image grid family*.jpg -c 4 -g 20 -b "#f5f5f5"
1732
+
1733
+ # Portfolio grid
1734
+ mediaproc image grid portfolio/*.jpg -r 2 -c 5 -w 300 -h 300 -g 15
1735
+ ```
1736
+
1737
+ **Auto Layout:**
1738
+ - If no columns/rows specified: Auto-calculates square-ish grid
1739
+ - If only columns specified: Auto-calculates rows
1740
+ - If only rows specified: Auto-calculates columns
1741
+ - 4 images → 2x2, 6 images → 2x3, 9 images → 3x3
1742
+
1743
+ **Cell Sizing:**
1744
+ - All images resized to cell dimensions
1745
+ - Uses "cover" fit mode (maintains aspect ratio, crops if needed)
1746
+ - Images centered in cells
1747
+ - Quality preserved during resize
1748
+
1749
+ **Common Grid Sizes:**
1750
+ - **2x2** - Four image collage (1200x1200 typical)
1751
+ - **3x3** - Instagram multi-post (1200x1200 or 1800x1800)
1752
+ - **1x3** - Horizontal trio (900x300 typical)
1753
+ - **3x1** - Vertical trio (300x900 typical)
1754
+ - **4x4** - Photo album page (1600x1600)
1755
+
1756
+ **Social Media Presets:**
1757
+ ```bash
1758
+ # Instagram post (3x3)
1759
+ grid *.jpg -c 3 -w 400 -h 400 -g 0 -o insta.jpg
1760
+
1761
+ # Facebook cover
1762
+ grid *.jpg -c 5 -r 2 -w 200 -h 200 -g 10
1763
+
1764
+ # Pinterest board
1765
+ grid *.jpg -c 4 -w 250 -h 350 -g 15
1766
+ ```
1767
+
1768
+ **Use Cases:**
1769
+ - 📱 Instagram multi-image posts
1770
+ - 📸 Photo albums and galleries
1771
+ - 🎨 Portfolio presentations
1772
+ - 📊 Before/after comparisons
1773
+ - 🏠 Real estate property showcases
1774
+ - 👗 Product variation displays
1775
+ - 🎬 Video thumbnails/previews
1776
+ - 📚 Magazine-style layouts
1777
+
1778
+ **Background Colors:**
1779
+ - **white** - Clean, professional
1780
+ - **black** - Dramatic, artistic
1781
+ - **#f5f5f5** - Subtle gray
1782
+ - **transparent** - For PNG overlays
1783
+ - **#hex or rgb()** - Custom brand colors
1784
+
1785
+ **Tips:**
1786
+ - Use zero gap (-g 0) for seamless grids
1787
+ - Larger cells (400-500px) for high quality
1788
+ - Consistent cell sizes look more professional
1789
+ - Match background to destination (white for web)
1790
+ - Use -g 20-30 for print layouts
1791
+
1792
+ ---
1793
+
1794
+ ### 40. **composite** - Advanced Layer Blending
1795
+
1796
+ *See command #20 above for full composite documentation*
1797
+
1798
+ ---
1799
+
1800
+ ## 🎯 Command Quick Reference
1801
+
1802
+ | Category | Commands | Count |
1803
+ |----------|----------|-------|
1804
+ | **Transform** | resize, crop, rotate, flip, trim, extend, thumbnail | 7 |
1805
+ | **Color** | modulate, gamma, tint, grayscale, negate, normalize | 6 |
1806
+ | **Effects** | blur, sharpen, median, sepia, vignette, pixelate | 6 |
1807
+ | **Advanced** | composite, extract, border, clahe, convolve, watermark | 6 |
1808
+ | **Smart/AI** | smart-crop, auto-enhance, palette, dominant-color, grid, batch | 6 |
1809
+ | **Utility** | convert, optimize, stats, split, stack, mirror, metadata | 7 |
1810
+ | **TOTAL** | | **40** |
1811
+
1812
+ ---
1813
+
1814
+ Combine multiple images into a grid/collage layout with customizable spacing and background.
1815
+
1816
+ **Usage:**
1817
+ ```bash
1818
+ mediaproc image grid <images...> [options]
1819
+ ```
1820
+
1821
+ **Options:**
1822
+ - `-c, --columns <number>` - Number of columns (auto-calculated if not specified)
1823
+ - `-r, --rows <number>` - Number of rows (auto-calculated if not specified)
1824
+ - `-w, --width <pixels>` - Width of each cell (default: 300)
1825
+ - `-h, --height <pixels>` - Height of each cell (default: 300)
1826
+ - `-g, --gap <pixels>` - Gap between images (default: 10)
1827
+ - `-b, --background <color>` - Background color (default: white)
1828
+ - `-o, --output <path>` - Output file path (default: grid.png)
1829
+
1830
+ **Examples:**
1831
+ ```bash
1832
+ # Create 2x2 grid
1833
+ mediaproc image grid img1.jpg img2.jpg img3.jpg img4.jpg
1834
+
1835
+ # 3-column layout with custom cell size
1836
+ mediaproc image grid photos/*.jpg -c 3 -w 400 -h 400
1837
+
1838
+ # Instagram post with black background
1839
+ mediaproc image grid *.png -c 3 -g 20 -b black
1840
+ ```
1841
+
1842
+ ---
1843
+
1844
+ ### 34. **split** - Split Image into Tiles
1845
+
1846
+ Divide large images into smaller tiles, perfect for Instagram carousels or large format printing.
1847
+
1848
+ **Usage:**
1849
+ ```bash
1850
+ mediaproc image split <input> [options]
1851
+ ```
1852
+
1853
+ **Options:**
1854
+ - `-t, --tiles <pattern>` - Grid pattern (e.g., "3x3", "1x10")
1855
+ - `-r, --rows <number>` - Number of rows
1856
+ - `-c, --columns <number>` - Number of columns
1857
+ - `-o, --output <dir>` - Output directory (default: ./tiles)
1858
+
1859
+ **Examples:**
1860
+ ```bash
1861
+ # Split into 3x3 grid
1862
+ mediaproc image split photo.jpg --tiles 3x3
1863
+
1864
+ # Instagram carousel (10 horizontal slices)
1865
+ mediaproc image split panorama.jpg -t "1x10"
1866
+
1867
+ # Large poster into 4x4 tiles for printing
1868
+ mediaproc image split poster.jpg -r 4 -c 4 -o ./poster-tiles
1869
+
1870
+ # Vertical split for comparison
1871
+ mediaproc image split before-after.jpg --tiles "1x2"
1872
+ ```
1873
+
1874
+ **Tile Naming:**
1875
+ - Output files named: `tile_row_col.ext` (e.g., `tile_0_0.jpg`, `tile_0_1.jpg`)
1876
+ - Zero-indexed coordinates
1877
+ - Preserves original format
1878
+
1879
+ **Common Patterns:**
1880
+ - **1x10** - Instagram carousel (panorama)
1881
+ - **2x2** - Four-way comparison
1882
+ - **3x3** - Nine-tile puzzle
1883
+ - **4x4** - Large format printing
1884
+ - **1x2** - Before/after split
1885
+
1886
+ **Use Cases:**
1887
+ - Instagram carousel posts
1888
+ - Large format printing on small printers
1889
+ - Image puzzles
1890
+ - Tiled backgrounds
1891
+ - Progressive image loading
1892
+
1893
+ ---
1894
+
1895
+ ### 35. **metadata** - EXIF/Metadata Management
1896
+
1897
+ View, export, or remove image metadata including EXIF, IPTC, and XMP data.
1898
+
1899
+ **Usage:**
1900
+ ```bash
1901
+ mediaproc image metadata <input> [options]
1902
+ ```
1903
+
1904
+ **Options:**
1905
+ - `--remove` - Remove all metadata (create clean copy)
1906
+ - `--export <path>` - Export metadata to JSON file
1907
+ - `-o, --output <path>` - Output file path (when removing metadata)
1908
+ - `-v, --verbose` - Show detailed metadata information
1909
+ - `--help` - Display help
1910
+
1911
+ **Examples:**
1912
+ ```bash
1913
+ # View basic metadata
1914
+ mediaproc image metadata photo.jpg
1915
+
1916
+ # View detailed metadata
1917
+ mediaproc image metadata photo.jpg -v
1918
+
1919
+ # Remove all metadata for privacy
1920
+ mediaproc image metadata photo.jpg --remove
1921
+
1922
+ # Export metadata to JSON
1923
+ mediaproc image metadata photo.jpg --export metadata.json
1924
+
1925
+ # Clean copy without GPS data
1926
+ mediaproc image metadata photo.jpg --remove -o clean.jpg
1927
+ ```
1928
+
1929
+ **Metadata Types:**
1930
+ - **EXIF** - Camera settings, date, GPS location, device info
1931
+ - **IPTC** - Copyright, caption, keywords, author
1932
+ - **XMP** - Extended metadata, Adobe properties
1933
+ - **ICC** - Color profile information
1934
+ - **Orientation** - Image rotation data
1935
+
1936
+ **Information Displayed:**
1937
+ - File size and modified date
1938
+ - Image dimensions and format
1939
+ - Color space and channels
1940
+ - DPI/density settings
1941
+ - Complete EXIF tags (camera, lens, settings)
1942
+ - GPS coordinates (if present)
1943
+ - Copyright and attribution
1944
+
1945
+ **Why Remove Metadata:**
1946
+ - 🔒 **Privacy** - Remove GPS location data
1947
+ - 📉 **File Size** - Metadata can add 10-50KB
1948
+ - 🛡️ **Security** - Remove camera/device info
1949
+ - 🌐 **Web Optimization** - Smaller files load faster
1950
+ - 🤝 **Clean Sharing** - Remove personal data
1951
+
1952
+ **File Size Impact:**
1953
+ - Metadata typically: 10-50KB
1954
+ - GPS data: ~500 bytes
1955
+ - Thumbnails in EXIF: 5-30KB
1956
+ - Total savings: 5-15% of file size
1957
+
1958
+ ---
1959
+
1960
+ ### 36. **stack** - Stack Images Horizontally/Vertically
1961
+
1962
+ Stack multiple images horizontally or vertically with alignment and spacing control.
1963
+
1964
+ **Usage:**
1965
+ ```bash
1966
+ mediaproc image stack <images...> [options]
1967
+ ```
1968
+
1969
+ **Options:**
1970
+ - `-d, --direction <direction>` - Stack direction: horizontal, vertical (default: horizontal)
1971
+ - `-a, --align <alignment>` - Alignment: start, center, end (default: center)
1972
+ - `-g, --gap <pixels>` - Gap between images in pixels (default: 0)
1973
+ - `-b, --background <color>` - Background color for gaps (default: transparent)
1974
+ - `-o, --output <path>` - Output file path (default: stacked.png)
1975
+ - `--dry-run` - Preview without executing
1976
+ - `-v, --verbose` - Show detailed output
1977
+
1978
+ **Examples:**
1979
+ ```bash
1980
+ # Horizontal before/after comparison
1981
+ mediaproc image stack before.jpg after.jpg
1982
+
1983
+ # Vertical stack with white gaps
1984
+ mediaproc image stack img1.jpg img2.jpg img3.jpg -d vertical -g 20 -b white
1985
+
1986
+ # Create panorama
1987
+ mediaproc image stack panorama1.jpg panorama2.jpg panorama3.jpg -d horizontal -o panorama.jpg
1988
+
1989
+ # Right-aligned horizontal stack
1990
+ mediaproc image stack photo1.jpg photo2.jpg -a end
1991
+
1992
+ # Instagram story sequence
1993
+ mediaproc image stack story*.jpg -d vertical -g 10 -b black
1994
+ ```
1995
+
1996
+ **Direction & Alignment:**
1997
+ - **horizontal + start** - Images aligned to top
1998
+ - **horizontal + center** - Images centered vertically (default)
1999
+ - **horizontal + end** - Images aligned to bottom
2000
+ - **vertical + start** - Images aligned to left
2001
+ - **vertical + center** - Images centered horizontally (default)
2002
+ - **vertical + end** - Images aligned to right
2003
+
2004
+ **Use Cases:**
2005
+ - Before/after comparisons
2006
+ - Image sequences and timelines
2007
+ - Panorama creation
2008
+ - Portfolio layouts
2009
+ - Tutorial step-by-step guides
2010
+ - Product variation displays
2011
+ - Comparison charts
2012
+ - Story sequences
2013
+
2014
+ **Tips:**
2015
+ - Use gaps (10-20px) for visual separation
2016
+ - Transparent background works best with PNG output
2017
+ - Horizontal for wide comparisons
2018
+ - Vertical for tall/portrait layouts
2019
+ - Center alignment usually looks best
2020
+
2021
+ ---
2022
+
2023
+ ### 37. **mirror** - Mirror & Kaleidoscope Effects
2024
+
2025
+ Create stunning mirror and kaleidoscope effects by reflecting images in various ways.
2026
+
2027
+ **Usage:**
2028
+ ```bash
2029
+ mediaproc image mirror <input> [options]
2030
+ ```
2031
+
2032
+ **Options:**
2033
+ - `-m, --mode <mode>` - Mirror mode: horizontal, vertical, both, quad (default: horizontal)
2034
+ - `-o, --output <path>` - Output file path (default: <input>-mirror-<mode>.ext)
2035
+ - `--dry-run` - Preview without executing
2036
+ - `-v, --verbose` - Show detailed output
2037
+
2038
+ **Examples:**
2039
+ ```bash
2040
+ # Horizontal mirror (left-right symmetry)
2041
+ mediaproc image mirror photo.jpg
2042
+
2043
+ # Vertical mirror (water reflection)
2044
+ mediaproc image mirror landscape.jpg --mode vertical
2045
+
2046
+ # Both axes (4-way symmetry)
2047
+ mediaproc image mirror portrait.jpg --mode both
2048
+
2049
+ # Kaleidoscope effect (quad mirror)
2050
+ mediaproc image mirror photo.jpg --mode quad
2051
+ ```
2052
+
2053
+ **Mirror Modes:**
2054
+ - **horizontal** - Mirror left to right (creates left-right symmetry)
2055
+ - Output: 2x original width
2056
+ - Perfect for face symmetry experiments
2057
+
2058
+ - **vertical** - Mirror top to bottom (creates top-bottom symmetry)
2059
+ - Output: 2x original height
2060
+ - Perfect for water reflections, sky mirrors
2061
+
2062
+ - **both** - Mirror on both axes (creates 4-way symmetry)
2063
+ - Output: 2x width × 2x height
2064
+ - Creates complete symmetry
2065
+
2066
+ - **quad** - Kaleidoscope effect (mirrors center quadrant)
2067
+ - Output: Original size with center mirrored 4 ways
2068
+ - Creates mandala-like patterns
2069
+
2070
+ **Creative Uses:**
2071
+ - 🪞 Water reflections (vertical mode)
2072
+ - 👤 Symmetrical portraits
2073
+ - 🎨 Kaleidoscope art (quad mode)
2074
+ - 🌀 Abstract patterns
2075
+ - 🦋 Rorschach test style images
2076
+ - 🏛️ Architectural symmetry
2077
+ - 🌸 Mandala-like designs
2078
+ - 🎭 Surreal art effects
2079
+
2080
+ **Best Practices:**
2081
+ - Works best with asymmetric input images
2082
+ - Quad mode creates most dramatic effects
2083
+ - Combine with other effects for unique results
2084
+ - Try different modes on the same image
2085
+
2086
+ ---
2087
+
2088
+ ### 38. **dominant-color** - Quick Color Extraction
2089
+
2090
+ Quickly extract the most dominant colors from an image for instant palette generation.
2091
+
2092
+ **Usage:**
2093
+ ```bash
2094
+ mediaproc image dominant-color <input> [options]
2095
+ ```
2096
+
2097
+ **Options:**
2098
+ - `-c, --count <number>` - Number of dominant colors to extract (default: 5, max: 10)
2099
+ - `--export <path>` - Export color palette to JSON file
2100
+ - `-v, --verbose` - Show detailed RGB/HSL values
2101
+ - `--help` - Display help
2102
+
2103
+ **Examples:**
2104
+ ```bash
2105
+ # Extract top 5 dominant colors
2106
+ mediaproc image dominant-color photo.jpg
2107
+
2108
+ # Get top 3 colors
2109
+ mediaproc image dominant-color logo.png --count 3
2110
+
2111
+ # Export palette to JSON
2112
+ mediaproc image dominant-color photo.jpg --export palette.json
2113
+
2114
+ # Detailed color info
2115
+ mediaproc image dominant-color artwork.jpg -c 5 -v
2116
+ ```
2117
+
2118
+ **Output Format:**
2119
+ - 🎨 **Visual Preview** - Colored blocks in terminal
2120
+ - 🔢 **Hex Codes** - #RRGGBB format
2121
+ - 📊 **Coverage Percentage** - How much of image uses each color
2122
+ - 🌈 **RGB Values** - (r, g, b) with -v flag
2123
+ - 🎨 **HSL Values** - (hue, saturation, lightness) with -v flag
2124
+
2125
+ **Color Analysis:**
2126
+ - Colors sorted by dominance (most to least)
2127
+ - Percentage shows coverage in image
2128
+ - Bucketed to reduce near-identical colors
2129
+ - Automatically filters similar shades
2130
+
2131
+ **Use Cases:**
2132
+ - 🎨 Generate color palettes for design projects
2133
+ - 🏢 Brand color extraction from logos
2134
+ - 🌐 Website theme generation
2135
+ - 📱 App UI color schemes
2136
+ - 🎬 Video/film color grading reference
2137
+ - 🖌️ Digital art inspiration
2138
+ - 👗 Fashion color matching
2139
+ - 🏠 Interior design palettes
2140
+
2141
+ **Export JSON Format:**
2142
+ ```json
2143
+ {
2144
+ "source": "photo.jpg",
2145
+ "imageSize": { "width": 1920, "height": 1080 },
2146
+ "colors": [
2147
+ {
2148
+ "hex": "#3a5f7d",
2149
+ "rgb": { "r": 58, "g": 95, "b": 125 },
2150
+ "hsl": { "h": 207, "s": 37, "l": 36 },
2151
+ "percentage": 23.5
2152
+ }
2153
+ ]
2154
+ }
2155
+ ```
2156
+
2157
+ **Tips:**
2158
+ - Use fewer colors (2-3) for minimalist palettes
2159
+ - 5-7 colors ideal for comprehensive palettes
2160
+ - Export to JSON for use in design tools
2161
+ - Smaller images process faster (auto-optimized)
2162
+ - Works best with high-contrast images
2163
+
2164
+ ---
2165
+
2166
+ ### 39. **grid** - Create Image Collages
2167
+
2168
+ # Instagram carousel (10 horizontal slices)
2169
+ mediaproc image split panorama.jpg -t "1x10"
2170
+
2171
+ # Large poster into 4x4 tiles
2172
+ mediaproc image split poster.jpg -r 4 -c 4 -o ./poster-tiles
2173
+ ```
2174
+
2175
+ ---
2176
+
2177
+ ### 35. **metadata** - View/Export/Remove Metadata
2178
+
2179
+ View, export to JSON, or remove EXIF/IPTC/XMP metadata from images.
2180
+
2181
+ **Usage:**
2182
+ ```bash
2183
+ mediaproc image metadata <input> [options]
2184
+ ```
2185
+
2186
+ **Options:**
2187
+ - `--remove` - Remove all metadata (create clean copy)
2188
+ - `--export <path>` - Export metadata to JSON file
2189
+ - `-o, --output <path>` - Output file (when removing metadata)
2190
+ - `-v, --verbose` - Show detailed metadata
2191
+
2192
+ **Examples:**
2193
+ ```bash
2194
+ # View metadata
2195
+ mediaproc image metadata photo.jpg
2196
+
2197
+ # Remove all metadata for privacy
2198
+ mediaproc image metadata photo.jpg --remove
2199
+
2200
+ # Export metadata to JSON
2201
+ mediaproc image metadata photo.jpg --export data.json
2202
+
2203
+ # Clean copy without GPS data
2204
+ mediaproc image metadata photo.jpg --remove -o clean.jpg
2205
+ ```
2206
+
2207
+ ---
2208
+
2209
+ ### 36. **stack** - Stack Images
2210
+
2211
+ Stack multiple images horizontally or vertically with customizable alignment and spacing.
2212
+
2213
+ **Usage:**
2214
+ ```bash
2215
+ mediaproc image stack <images...> [options]
2216
+ ```
2217
+
2218
+ **Options:**
2219
+ - `-d, --direction <direction>` - Stack direction: horizontal, vertical (default: horizontal)
2220
+ - `-a, --align <alignment>` - Alignment: start, center, end (default: center)
2221
+ - `-g, --gap <pixels>` - Gap between images (default: 0)
2222
+ - `-b, --background <color>` - Background color for gaps (default: transparent)
2223
+ - `-o, --output <path>` - Output file path
2224
+
2225
+ **Examples:**
2226
+ ```bash
2227
+ # Horizontal before/after comparison
2228
+ mediaproc image stack before.jpg after.jpg
2229
+
2230
+ # Vertical stack with white gaps
2231
+ mediaproc image stack img1.jpg img2.jpg img3.jpg -d vertical -g 20 -b white
2232
+
2233
+ # Create panorama
2234
+ mediaproc image stack panorama*.jpg -d horizontal -o panorama.jpg
2235
+ ```
2236
+
2237
+ ---
2238
+
2239
+ ### 37. **mirror** - Create Mirror Effects
2240
+
2241
+ Create mirror and kaleidoscope effects by reflecting images horizontally, vertically, or in quadrants.
2242
+
2243
+ **Usage:**
2244
+ ```bash
2245
+ mediaproc image mirror <input> [options]
2246
+ ```
2247
+
2248
+ **Options:**
2249
+ - `-m, --mode <mode>` - Mirror mode: horizontal, vertical, both, quad (default: horizontal)
2250
+ - `-o, --output <path>` - Output file path
2251
+
2252
+ **Examples:**
2253
+ ```bash
2254
+ # Horizontal mirror (left-right symmetry)
2255
+ mediaproc image mirror photo.jpg
2256
+
2257
+ # Vertical mirror (water reflection)
2258
+ mediaproc image mirror landscape.jpg --mode vertical
2259
+
2260
+ # Kaleidoscope effect
2261
+ mediaproc image mirror photo.jpg --mode quad
2262
+ ```
2263
+
2264
+ ---
2265
+
2266
+ ### 38. **dominant-color** - Extract Dominant Colors
2267
+
2268
+ Quickly extract the most dominant colors from an image for palette generation.
2269
+
2270
+ **Usage:**
2271
+ ```bash
2272
+ mediaproc image dominant-color <input> [options]
2273
+ ```
2274
+
2275
+ **Options:**
2276
+ - `-c, --count <number>` - Number of colors to extract (default: 5, max: 10)
2277
+ - `--export <path>` - Export color palette to JSON file
2278
+ - `-v, --verbose` - Show detailed RGB/HSL values
2279
+
2280
+ **Examples:**
2281
+ ```bash
2282
+ # Extract top 5 colors
2283
+ mediaproc image dominant-color photo.jpg
2284
+
2285
+ # Get top 3 colors
2286
+ mediaproc image dominant-color logo.png --count 3
2287
+
2288
+ # Export to JSON for design tools
2289
+ mediaproc image dominant-color photo.jpg --export palette.json
2290
+ ```
2291
+
2292
+ ---
2293
+
2294
+ ## � Real-World Workflows
2295
+
2296
+ ### Workflow 1: Web Optimization Pipeline
2297
+ ```bash
2298
+ # 1. Resize for responsive web
2299
+ mediaproc image resize photo.jpg -w 1920 --fit inside -o web-large.jpg
2300
+
2301
+ # 2. Optimize with quality 85
2302
+ mediaproc image optimize web-large.jpg -q 85
2303
+
2304
+ # 3. Convert to modern WebP format
2305
+ mediaproc image convert web-large-optimized.jpg -f webp -q 85
2306
+
2307
+ # 4. Generate thumbnail
2308
+ mediaproc image thumbnail web-large.jpg -s 300 -o thumb.jpg
2309
+
2310
+ # Result: web-large-optimized.webp (smallest), thumb.jpg (preview)
2311
+ ```
2312
+
2313
+ ### Workflow 2: Social Media Prep
2314
+ ```bash
2315
+ # Instagram square post
2316
+ mediaproc image smart-crop photo.jpg -w 1080 -h 1080 -o instagram.jpg
2317
+
2318
+ # Facebook cover
2319
+ mediaproc image smart-crop photo.jpg -w 820 -h 312 -o facebook-cover.jpg
2320
+
2321
+ # Twitter card
2322
+ mediaproc image smart-crop photo.jpg -w 1200 -h 675 -o twitter-card.jpg
2323
+
2324
+ # Remove metadata before uploading
2325
+ mediaproc image metadata instagram.jpg --remove -o instagram-clean.jpg
2326
+ ```
2327
+
2328
+ ### Workflow 3: Photo Enhancement Pipeline
2329
+ ```bash
2330
+ # 1. Auto-enhance
2331
+ mediaproc image auto-enhance photo.jpg --level medium
2332
+
2333
+ # 2. Fine-tune colors
2334
+ mediaproc image modulate photo-auto-enhanced.jpg -b 1.1 -s 1.2
2335
+
2336
+ # 3. Add artistic vignette
2337
+ mediaproc image vignette photo-auto-enhanced-modulated.jpg -i 40
2338
+
2339
+ # 4. Final sharpening
2340
+ mediaproc image sharpen photo-auto-enhanced-modulated-vignette.jpg -s 1.2
2341
+
2342
+ # Result: Professional photo ready for portfolio
2343
+ ```
2344
+
2345
+ ### Workflow 4: Batch Product Photos
2346
+ ```bash
2347
+ # Process entire product directory
2348
+ mediaproc image batch ./products --operation resize --width 1200 --height 1200 -o ./web-products
2349
+
2350
+ # Add white borders
2351
+ for file in ./web-products/*.jpg; do
2352
+ mediaproc image border "$file" -w 20 -c white
2353
+ done
2354
+
2355
+ # Remove backgrounds (if AI plugin available)
2356
+ # Then optimize all
2357
+ mediaproc image batch ./web-products -op optimize -q 90
2358
+ ```
2359
+
2360
+ ### Workflow 5: Instagram Carousel Creation
2361
+ ```bash
2362
+ # 1. Create panorama from multiple images
2363
+ mediaproc image stack img1.jpg img2.jpg img3.jpg -d horizontal -o panorama.jpg
2364
+
2365
+ # 2. Split into 10 tiles for carousel
2366
+ mediaproc image split panorama.jpg --tiles "1x10" -o ./carousel
2367
+
2368
+ # 3. Optimize each tile
2369
+ mediaproc image batch ./carousel -op optimize -q 90
2370
+
2371
+ # Result: 10 tiles ready for Instagram carousel post
2372
+ ```
2373
+
2374
+ ### Workflow 6: Portfolio Grid
2375
+ ```bash
2376
+ # Create 3x3 portfolio grid
2377
+ mediaproc image grid portfolio/*.jpg -c 3 -w 500 -h 500 -g 15 -b "#f5f5f5" -o portfolio-grid.jpg
2378
+
2379
+ # Add watermark
2380
+ mediaproc image watermark portfolio-grid.jpg logo.png --position bottom-right --opacity 0.4
2381
+
2382
+ # Optimize for web
2383
+ mediaproc image optimize portfolio-grid-watermark.jpg -q 88 -o final-portfolio.jpg
2384
+ ```
2385
+
2386
+ ### Workflow 7: Before/After Comparison
2387
+ ```bash
2388
+ # Stack horizontally
2389
+ mediaproc image stack before.jpg after.jpg -d horizontal -g 20 -b white -o comparison.jpg
2390
+
2391
+ # Add border
2392
+ mediaproc image border comparison.jpg -w 30 -c "#333333"
2393
+
2394
+ # Optimize
2395
+ mediaproc image optimize comparison-border.jpg -q 90
2396
+ ```
2397
+
2398
+ ### Workflow 8: Vintage Photo Restoration
2399
+ ```bash
2400
+ # 1. Denoise
2401
+ mediaproc image median old-photo.jpg -s 5
2402
+
2403
+ # 2. Normalize contrast
2404
+ mediaproc image normalize old-photo-median.jpg
2405
+
2406
+ # 3. Apply sepia for vintage look
2407
+ mediaproc image sepia old-photo-median-normalized.jpg -i 70
2408
+
2409
+ # 4. Add subtle vignette
2410
+ mediaproc image vignette old-photo-median-normalized-sepia.jpg -i 30
2411
+
2412
+ # Result: Restored vintage photo with character
2413
+ ```
2414
+
2415
+ ### Workflow 9: Privacy-Safe Sharing
2416
+ ```bash
2417
+ # 1. Remove all metadata (GPS, camera info)
2418
+ mediaproc image metadata vacation.jpg --remove -o clean.jpg
2419
+
2420
+ # 2. Resize to web size
2421
+ mediaproc image resize clean.jpg -w 1200 --fit inside
2422
+
2423
+ # 3. Compress for fast sharing
2424
+ mediaproc image optimize clean-1200w.jpg -q 80
2425
+
2426
+ # Result: Small, fast, privacy-safe image
2427
+ ```
2428
+
2429
+ ### Workflow 10: Creative Kaleidoscope Art
2430
+ ```bash
2431
+ # 1. Extract vibrant colors
2432
+ mediaproc image dominant-color photo.jpg -c 5 --export colors.json
2433
+
2434
+ # 2. Boost saturation
2435
+ mediaproc image modulate photo.jpg -s 1.5
2436
+
2437
+ # 3. Create quad mirror effect
2438
+ mediaproc image mirror photo-modulated.jpg --mode quad
2439
+
2440
+ # 4. Add border
2441
+ mediaproc image border photo-modulated-mirror-quad.jpg -w 40 -c black
2442
+
2443
+ # Result: Stunning kaleidoscope art piece
2444
+ ```
2445
+
2446
+ ### Batch Processing Tips
2447
+ ```bash
2448
+ # Process all JPGs in directory
2449
+ for file in *.jpg; do
2450
+ mediaproc image resize "$file" -w 1920 -o "processed_$file"
2451
+ done
2452
+
2453
+ # Convert all images to WebP
2454
+ for file in *.{jpg,png}; do
2455
+ mediaproc image convert "$file" -f webp -q 85
2456
+ done
2457
+
2458
+ # Create thumbnails for all images
2459
+ for file in images/*.jpg; do
2460
+ name=$(basename "$file" .jpg)
2461
+ mediaproc image thumbnail "$file" -s 200 -o "thumbs/$name-thumb.jpg"
2462
+ done
2463
+ ```
2464
+
2465
+ ---
2466
+
2467
+ ## �🐛 Troubleshooting
2468
+
2469
+ ### Command Not Found
2470
+ ```bash
2471
+ # Ensure CLI is installed
2472
+ npm list -g @mediaproc/cli
2473
+
2474
+ # Or use npx
2475
+ npx @mediaproc/cli image resize photo.jpg -w 800
2476
+ ```
2477
+
2478
+ ### Invalid Image Format
2479
+ ```bash
2480
+ # Check supported formats
2481
+ mediaproc image convert --help
2482
+
2483
+ # Supported: jpg, png, webp, avif, tiff, gif
2484
+ ```
2485
+
2486
+ ### Out of Memory
2487
+ ```bash
2488
+ # For very large images, consider:
2489
+ # 1. Resizing first
2490
+ mediaproc image resize huge.jpg -w 4000
2491
+
2492
+ # 2. Processing in smaller batches
2493
+ # 3. Using lower quality settings
2494
+ ```
2495
+
2496
+ ## 📚 Additional Resources
2497
+
2498
+ - [Sharp Documentation](https://sharp.pixelplumbing.com/)
2499
+ - [libvips](https://libvips.github.io/libvips/)
2500
+ - [Image Optimization Guide](https://web.dev/fast/#optimize-your-images)
2501
+
2502
+ ## 🤝 Contributing
2503
+
2504
+ Contributions are welcome! Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for details.
2505
+
2506
+ ## 📄 License
2507
+
2508
+ MIT License - see [LICENSE](../../LICENSE) for details.
2509
+
2510
+ ## 👤 Author
2511
+
2512
+ Created and maintained by [@0xshariq](https://github.com/0xshariq)
2513
+
2514
+ ---
2515
+
2516
+ **Made with ❤️ using [Sharp](https://sharp.pixelplumbing.com/)**