pulp-image 0.1.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.
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 415.5 529.41">
3
+ <defs>
4
+ <style>
5
+ .cls-1 {
6
+ fill: #fff;
7
+ }
8
+ </style>
9
+ </defs>
10
+ <g id="Layer_1-2" data-name="Layer 1">
11
+ <path class="cls-1" d="M346.12.2c.09,0,.59.93,1.5.98,8.97.51,17.82.1,26.76,2.26,3.07.74,5.89,2.08,6.6,5.48.48,2.29-1.61,10.51-2.35,13.3-15.83,59.86-73.32,98.41-134.93,89.91-3.05-.42-15.78-2.89-17.12-4.87-.93-1.42-.52-2.61.07-4.03,1.14-2.77,5.14-8.21,7.06-10.94,16.47-23.4,41.79-40.55,67.43-52.57l35.99-13.5c-27.66,1.78-55.6,10.61-78.92,25.57-11.6,7.44-22.26,17.3-31.6,27.4-2.09,2.26-6.52,9.56-9.1,9.93-2.37.31-3.07-4.87-3.17-6.68-.47-9.22,4.41-22.53,8.97-30.55C244.01,15.44,290.08,2.36,329.12.2c5.28-.29,11.7-.25,17,0ZM236.12,139.2c-.44,1.76.71,1.99,1.51,2.99,6.47,8.14,10.76,12.8,13.76,23.24,20.13,70.09-70.75,135.08-43.3,213.3,10.63,30.27,40.78,50.54,71.94,54.56,3.47,5-15.64,37.18-17.68,44.66-4.76,17.46-2.34,40.2,16.08,48.45s40.84-1.35,46.23-21.15c7.8-28.71-21.02-46.43-23.54-73.04,30.03-3.73,57.04-28.7,70.76-54.75,26.54-50.42,12.41-116.46-14.56-163.94-19.88-35-62.31-70.52-103.69-74.31-5.6-.51-11.82.37-17.5,0ZM358.34,285.49c5.45,10.48,2.86,25.11-9.19,29.24-18.38,6.3-29.57-16.02-19.48-30.48,2.57-3.68,7.51-7.59,12.13-7.76,5.86-.22,13.76,3.65,16.54,9ZM260.32,296.5c8.15,17.41-7.68,38.08-25.55,26.55-12.48-8.05-6.87-32.62,7.04-35.65,7.36-1.6,15.37,2.4,18.51,9.1ZM285.56,321.24c7.46,6.86,21.49,2.68,22.64-7.95,7.43-1.19,7.86,8.25,4.41,12.9-7.09,9.58-31.38,9.45-34.3-3.68-1.09-4.88,2.18-7.18,5.57-4.05.58.54.76,1.93,1.68,2.78ZM369.04,339.63c-5.49,4.34-14.1,4.49-19.46-.39-7.32-6.67.1-17.6,9.29-18.81,10.66-1.41,19.61,11.74,10.16,19.21ZM249.92,346.47c-1.67,10.61-16.91,13.77-24.75,8.18-11.05-7.87-2.42-22.59,10.36-21.41,2.85.27,10.46,3.18,12.34,5.21,1.64,1.76,2.44,5.61,2.06,8.02ZM288.18,502.64c1.39,1.02,4.07.79,4.79,3.22,2.24,7.59-8.97,9.33-14.36,5.35-11.73-8.67-7.4-30.05-2.76-41.78.5-1.26.54-2.95,2.26-3.23-2.68,11.06.38,29.34,10.07,36.44ZM204.12,402.7c-23.47-29.48-18.59-68.41-6.77-101.77,12.67-35.75,46.36-88.62,39.7-126.16-6.17-34.78-41.3-44.54-72.45-42.6-87.53,5.47-147.03,90.74-123.99,175.04,15.31,55.98,66.55,94.1,122.27,104.73,15.04,2.87,32.57,4.01,47.24-.76.47-3.88-3.84-5.79-6-8.49ZM62.35,309.47c-29.47-73.43,26.13-156.25,104.25-160.3,18.91-.98,41.86,6.02,48.56,25.49,11.42,33.16-22.28,84.52-34.54,115.54-12.19,30.85-19.88,67.05-7.5,98.99-47.6-4.67-92.69-34.67-110.77-79.72ZM118.43,130.01c15.23-6.54,31.01-7.87,45.94-13.06,5.85-2.04,10.06-6.62,6.22-12.71-2.56-4.05-11.56-3.38-15.99-3.06-24.6,1.76-52.08,12.13-72.79,25.21-108.78,68.66-108.48,216.91-2.63,288.26,37.1,25.01,94.65,42.97,139.37,37.48,9.21-1.13,24.79-2.97,21.09-15.95-.62-1.21-4.83-3.49-6.21-3.78-7.93-1.67-21.92.28-30.83-.17-50.09-2.56-99.61-20.78-134.78-56.73C-10.12,295.86,17.33,173.43,118.43,130.01ZM404.15,231.68c-21-59.08-73.99-107.51-138.5-110.5-8.77-.41-17.03,1.18-25.53,3.03-.61,2.07,1,2.49,2.71,2.76,4.57.73,9.81.68,14.53,1.49,95.18,16.3,146.01,124.63,138.78,213.27-.62,7.57-2.07,15.24-2.76,22.81.62,2.1.93,5.04,3.73,4.66,23.81-41.16,22.66-93.59,7.04-137.53ZM165.43,29.01c-4.24,1.88-19.1,8.81-20.81,12.18-.7,1.38-.78,2.89-.34,4.35.55,1.83,11.51,11.51,13.85,14.16,10.67,12.09,23.99,30.99,30.19,45.81,3.16,7.55,3.11,19.14,14.07,17.49,4.15-.63,5.27-2.83,6.48-6.56,2.15-6.61.99-15.68.19-22.67-2.1-18.27-8.73-42.06-18.11-57.89-3.07-5.18-7.21-12.58-14.09-11.48-2.58.41-8.62,3.37-11.42,4.61ZM337.79,297.03c12.47,3.73,11.35-14.91,1.03-12.65-6.02,1.32-6.37,11.05-1.03,12.65ZM240.62,297.2c-3.9,7.86,5.96,13.74,11.24,7.75,5.89-6.67-7.21-15.88-11.24-7.75ZM95.57,218.26c3.78,18.96,35.06,30.62,52.12,31.88,2.98.22,5.64.27,7.96-1.89,2.82-4.29-2.73-13.98-5.11-17.96-7.94-13.3-25.44-33.84-42.71-30.85-9.08,1.57-14.04,9.92-12.27,18.83ZM81.67,266.25c-6.34,8.85-1.34,20.85,8.45,24.45,9.35,3.44,17.63,2.64,27.01.01,5.12-1.43,27.93-11.55,28.94-16.11-.14-1.88-2.21-3.21-3.61-4.24-10.98-8.11-29.98-14.57-43.59-12.89-5.89.73-13.65,3.82-17.21,8.79ZM152.2,194.63c1.42,12.47,14.84,31.12,25.58,37.42,3.93,2.3,6.8,4.14,8.63-1.05,3.71-10.53,5.31-27.14,2.25-37.83-2.63-9.19-11.4-19.49-21.78-18.76-10.92.76-15.83,10.17-14.69,20.23ZM115.67,312.25c-10.58,14.93,6.07,33.06,19.82,24.82,6.92-4.15,16.38-19.04,19.4-26.6,1.68-4.19,6.16-17.75,3.78-21.33-1.55-1.53-3.89-1.05-5.84-.73-12.03,2.02-30.14,13.92-37.17,23.83Z"/>
12
+ </g>
13
+ </svg>
package/ui/index.html ADDED
@@ -0,0 +1,475 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Pulp Image - Browser UI</title>
7
+ <link rel="stylesheet" href="styles.css">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <header class="header">
12
+ <div class="brand">
13
+ <img src="/assets/pulp-logo-white.svg" alt="Pulp Image logo" class="logo">
14
+ <div class="brand-text">
15
+ <h1>Pulp Image</h1>
16
+ <p class="brand-subtitle">by Rebellion Geeks <span class="version" id="version">v0.1.0</span></p>
17
+ </div>
18
+ </div>
19
+ </header>
20
+
21
+ <main class="main-content">
22
+ <div class="tabs">
23
+ <button class="tab-button active" data-tab="process">Process Images</button>
24
+ <button class="tab-button" data-tab="help">Help & CLI Reference</button>
25
+ </div>
26
+
27
+ <!-- Process Tab -->
28
+ <div class="tab-content active" id="process-tab">
29
+ <form id="process-form" class="process-form">
30
+ <!-- Input Source -->
31
+ <div class="form-group">
32
+ <label class="form-label">
33
+ Input Source <span class="required">*</span>
34
+ </label>
35
+
36
+ <!-- Input Mode Switch -->
37
+ <div class="input-mode-switch">
38
+ <label class="radio-label">
39
+ <input type="radio" name="input-mode" value="files" checked>
40
+ <span>Files</span>
41
+ </label>
42
+ <label class="radio-label">
43
+ <input type="radio" name="input-mode" value="folder">
44
+ <span>Folder</span>
45
+ </label>
46
+ </div>
47
+
48
+ <!-- Files Input -->
49
+ <input type="file" id="input-source-files" class="file-input" multiple accept="image/png,image/jpeg,image/webp,image/avif" style="display: block;">
50
+
51
+ <!-- Folder Input -->
52
+ <input type="file" id="input-source-folder" class="file-input" webkitdirectory directory multiple style="display: none;">
53
+
54
+ <div class="input-helper" id="input-helper">
55
+ Select one or more image files. Supports PNG, JPG, WebP, AVIF. Multiple files will be processed as a batch.
56
+ </div>
57
+
58
+ <!-- Folder mode privacy notice -->
59
+ <div id="folder-privacy-notice" class="privacy-notice" style="display: none;">
60
+ <div class="privacy-notice-content">
61
+ <strong>Privacy note:</strong> Files are processed locally on your computer. Browsers may show a security prompt when selecting folders. No files are uploaded to the internet.
62
+ </div>
63
+ <div class="privacy-notice-browser" style="margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-secondary);">
64
+ Your browser may ask for permission to access this folder.
65
+ </div>
66
+ </div>
67
+
68
+ <!-- File List Preview -->
69
+ <div id="input-preview" class="input-preview">
70
+ <div class="file-list-summary">
71
+ <span id="file-list-summary-text">No files selected</span>
72
+ <button type="button" id="toggle-file-list" class="toggle-file-list-btn" style="display: none;">Show files</button>
73
+ </div>
74
+ <div id="file-list-detail" class="file-list-detail" style="display: none;">
75
+ <!-- File list will be populated here -->
76
+ </div>
77
+ <div style="margin-top: 0.5rem;">
78
+ <button type="button" id="toggle-ignored-files" class="toggle-file-list-btn toggle-file-list-btn-secondary" style="display: none;">Show ignored files</button>
79
+ </div>
80
+ <div id="ignored-files-list" class="file-list-detail ignored-files-list" style="display: none;">
81
+ <!-- Ignored files will be populated here -->
82
+ </div>
83
+ </div>
84
+ </div>
85
+
86
+ <!-- Output Directory -->
87
+ <div class="form-group">
88
+ <label for="output-dir" class="form-label">
89
+ Output Directory
90
+ </label>
91
+ <input type="text" id="output-dir" class="text-input" readonly>
92
+ <div class="input-helper" id="output-dir-helper">
93
+ Files will be saved in a new folder inside your home directory.
94
+ </div>
95
+
96
+ <!-- Advanced Output Options -->
97
+ <details class="advanced-options">
98
+ <summary class="advanced-options-summary">Advanced output options</summary>
99
+ <div class="advanced-options-content">
100
+ <label class="checkbox-label">
101
+ <input type="checkbox" id="use-custom-output">
102
+ <span class="checkbox-text">Use custom output directory</span>
103
+ </label>
104
+ <div class="input-helper">
105
+ When enabled, you can specify a custom output directory. Use ~ for home directory.
106
+ </div>
107
+ </div>
108
+ </details>
109
+
110
+ <div class="form-actions-inline" style="margin-top: 0.5rem;">
111
+ <div style="display: flex; flex-direction: column; gap: 0.5rem;">
112
+ <button type="button" id="open-results-folder" class="button button-secondary" style="display: none;">
113
+ Open results folder
114
+ </button>
115
+ <div id="open-results-folder-helper" class="button-helper-text" style="display: none;"></div>
116
+ <div id="open-results-folder-fallback" class="folder-open-fallback" style="display: none;">
117
+ <div class="folder-open-fallback-message"></div>
118
+ <div class="folder-open-fallback-path"></div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
123
+
124
+ <!-- Format -->
125
+ <div class="form-group">
126
+ <label for="format" class="form-label">Output Format</label>
127
+ <select id="format" class="select-input">
128
+ <option value="">Keep original format</option>
129
+ <option value="png">PNG - Lossless, supports transparency</option>
130
+ <option value="jpg">JPG - Lossy, best for photos, no transparency</option>
131
+ <option value="webp">WebP - Modern format, good compression</option>
132
+ <option value="avif">AVIF - Best compression, modern browsers</option>
133
+ </select>
134
+ <div class="input-helper" id="format-helper">
135
+ Select output format or keep original.
136
+ </div>
137
+ </div>
138
+
139
+ <!-- Width & Height -->
140
+ <div class="form-row">
141
+ <div class="form-group">
142
+ <label for="width" class="form-label">Width (px)</label>
143
+ <input type="number" id="width" class="number-input" min="1" placeholder="Auto">
144
+ <div class="input-helper">Leave empty to preserve aspect ratio</div>
145
+ </div>
146
+ <div class="form-group">
147
+ <label for="height" class="form-label">Height (px)</label>
148
+ <input type="number" id="height" class="number-input" min="1" placeholder="Auto">
149
+ <div class="input-helper">Leave empty to preserve aspect ratio</div>
150
+ </div>
151
+ </div>
152
+
153
+ <!-- Quality -->
154
+ <div class="form-group">
155
+ <label for="quality" class="form-label">
156
+ Quality <span id="quality-value" class="value-display">80</span>
157
+ </label>
158
+ <input type="range" id="quality" class="slider-input" min="1" max="100" value="80">
159
+ <div class="input-helper" id="quality-helper">
160
+ Quality for lossy formats (1-100). Higher = better quality but larger file.
161
+ </div>
162
+ </div>
163
+
164
+ <!-- Lossless -->
165
+ <div class="form-group">
166
+ <label class="toggle-label">
167
+ <input type="checkbox" id="lossless" class="toggle-input">
168
+ <span class="toggle-slider"></span>
169
+ <span class="toggle-text">Lossless Compression</span>
170
+ </label>
171
+ <div class="input-helper" id="lossless-helper">
172
+ Use lossless compression where supported (PNG, WebP, AVIF). PNG is always lossless.
173
+ </div>
174
+ </div>
175
+
176
+ <!-- Alpha Mode -->
177
+ <div class="form-group">
178
+ <label class="form-label">Alpha (Transparency) Handling</label>
179
+ <div class="radio-group">
180
+ <label class="radio-label">
181
+ <input type="radio" name="alpha-mode" value="flatten" checked>
182
+ <span>Flatten</span>
183
+ </label>
184
+ <label class="radio-label">
185
+ <input type="radio" name="alpha-mode" value="error">
186
+ <span>Error</span>
187
+ </label>
188
+ </div>
189
+ <div class="input-helper">
190
+ Flatten: Composite transparency onto background color. Error: Fail if transparency is present.
191
+ </div>
192
+ </div>
193
+
194
+ <!-- Background Color -->
195
+ <div class="form-group">
196
+ <label for="background" class="form-label">Background Color</label>
197
+ <div class="color-input-wrapper">
198
+ <input type="color" id="background" class="color-input" value="#ffffff">
199
+ <input type="text" id="background-text" class="color-text-input" value="#ffffff" readonly>
200
+ </div>
201
+ <div class="input-helper">
202
+ Background color for flattening transparency (used when converting to formats without transparency).
203
+ </div>
204
+ </div>
205
+
206
+ <!-- Rename Pattern -->
207
+ <div class="form-group">
208
+ <label for="rename-pattern" class="form-label">Rename Pattern (optional)</label>
209
+ <input type="text" id="rename-pattern" class="text-input" placeholder="e.g., {name}-optimized.{ext}">
210
+ <div class="input-helper">
211
+ Supported tokens: <code>{name}</code> (original basename), <code>{ext}</code> (output extension), <code>{index}</code> (1-based index).
212
+ The rename pattern fully controls the output filename. <code>{name}</code> is optional and can be omitted.
213
+ <br><br>
214
+ <strong>Example:</strong> <code>{index}-cute-animal.{ext}</code><br>
215
+ → <code>1-cute-animal.webp</code>, <code>2-cute-animal.webp</code>, <code>3-cute-animal.webp</code>
216
+ </div>
217
+ <div id="rename-preview" class="preview-text"></div>
218
+ </div>
219
+
220
+ <!-- Suffix (Legacy - keep for backward compatibility but deprecate) -->
221
+ <div class="form-group" style="display: none;">
222
+ <label for="suffix" class="form-label">Custom Suffix</label>
223
+ <input type="text" id="suffix" class="text-input" placeholder="e.g., optimized">
224
+ <div class="input-helper">
225
+ Custom suffix to add before file extension. Example: "optimized" creates "image-optimized.png"
226
+ </div>
227
+ <div id="suffix-preview" class="preview-text"></div>
228
+ </div>
229
+
230
+ <!-- Auto Suffix -->
231
+ <div class="form-group">
232
+ <label class="toggle-label">
233
+ <input type="checkbox" id="auto-suffix" class="toggle-input">
234
+ <span class="toggle-slider"></span>
235
+ <span class="toggle-text">Auto Suffix</span>
236
+ </label>
237
+ <div class="input-helper">
238
+ Automatically add size-based suffix: -800w (width), -600h (height), -800x600 (both).
239
+ </div>
240
+ <div id="auto-suffix-preview" class="preview-text"></div>
241
+ </div>
242
+
243
+ <!-- Overwrite -->
244
+ <div class="form-group">
245
+ <label class="checkbox-label">
246
+ <input type="checkbox" id="overwrite" class="checkbox-input">
247
+ <span class="checkbox-text">Overwrite Existing Files</span>
248
+ </label>
249
+ <div class="input-helper warning-text" id="overwrite-warning" style="display: none;">
250
+ ⚠️ Warning: This will overwrite existing output files.
251
+ </div>
252
+ </div>
253
+
254
+ <!-- Submit Button -->
255
+ <div class="form-actions">
256
+ <button type="submit" id="process-button" class="button button-primary">
257
+ Process Images
258
+ </button>
259
+ <button type="button" id="reset-button" class="button button-secondary">
260
+ Reset Form
261
+ </button>
262
+ </div>
263
+ </form>
264
+
265
+ <!-- Results Section -->
266
+ <div id="results-section" class="results-section" style="display: none;">
267
+ <div style="margin-bottom: 1rem;">
268
+ <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem;">
269
+ <h2 class="results-title" style="margin: 0;">Processing Results</h2>
270
+ <button type="button" id="open-results-folder-results" class="button button-secondary" style="display: none;">
271
+ Open results folder
272
+ </button>
273
+ </div>
274
+ <div id="open-results-folder-results-helper" class="button-helper-text" style="display: none; text-align: right;"></div>
275
+ <div id="open-results-folder-results-fallback" class="folder-open-fallback" style="display: none; text-align: right;">
276
+ <div class="folder-open-fallback-message"></div>
277
+ <div class="folder-open-fallback-path"></div>
278
+ </div>
279
+ </div>
280
+ <div id="results-content"></div>
281
+ </div>
282
+ </div>
283
+
284
+ <!-- Help Tab -->
285
+ <div class="tab-content" id="help-tab">
286
+ <div class="help-content">
287
+ <div class="help-info" style="background: var(--orange-bg-light); padding: 1rem; border-radius: var(--border-radius); margin-bottom: 2rem;">
288
+ <h2 style="margin-top: 0;">Welcome to Pulp Image by Rebellion Geeks</h2>
289
+ <p><strong>You do NOT need the CLI to use Pulp Image.</strong> The browser UI you're using right now works fully offline and is the easiest way to process your images. The CLI (command line interface) is optional and only needed for advanced workflows.</p>
290
+ </div>
291
+
292
+ <div class="help-info">
293
+ <h3>Why use the CLI?</h3>
294
+ <p>The browser UI works fully offline and is easiest for most users. The CLI exists for advanced workflows such as:</p>
295
+ <ul>
296
+ <li><strong>Deleting original files after processing</strong> - Due to browser security rules, some filesystem actions (like deleting original files) are only possible when using the CLI.</li>
297
+ <li>Automation and scripts - Running Pulp Image from other programs or scripts</li>
298
+ <li>Power-user batch workflows - Processing thousands of images with custom automation</li>
299
+ </ul>
300
+ <p><em>If you're happy using this browser interface, you don't need to install the CLI at all!</em></p>
301
+ </div>
302
+
303
+ <div class="help-info">
304
+ <h3>Using the CLI (Advanced / Optional)</h3>
305
+ <p>If you want to use the command line interface, follow these steps:</p>
306
+
307
+ <h4>Step 1: Install Node.js</h4>
308
+ <p>Pulp Image's CLI requires Node.js, which includes npm (Node Package Manager).</p>
309
+ <ul>
310
+ <li>Go to: <a href="https://nodejs.org" target="_blank" rel="noopener">https://nodejs.org</a></li>
311
+ <li>Download the LTS (Long Term Support) version</li>
312
+ <li>Install it like a normal app (double-click the installer and follow the prompts)</li>
313
+ <li>Restart your computer after installation</li>
314
+ </ul>
315
+
316
+ <h4>Step 2: Open a terminal</h4>
317
+ <p>You'll need to open a terminal (also called command prompt or command line) to run CLI commands:</p>
318
+ <ul>
319
+ <li><strong>macOS:</strong> Open Spotlight (press <kbd>Cmd + Space</kbd>), type "Terminal", then press Enter</li>
320
+ <li><strong>Windows:</strong> Press the Start button, type "Command Prompt" or "PowerShell", then open it</li>
321
+ <li><strong>Linux:</strong> Open your terminal application (usually found in your applications menu)</li>
322
+ </ul>
323
+
324
+ <h4>Step 3: Install Pulp Image CLI</h4>
325
+ <p>In the terminal, type this command and press Enter:</p>
326
+ <div class="example-block">
327
+ <code>npm install -g pulp-image</code>
328
+ </div>
329
+ <p>This installs Pulp Image globally (meaning it works from anywhere on your computer).</p>
330
+ <p><em>This may take a minute. If you see errors about permissions, consult npm's documentation or ask for help.</em></p>
331
+
332
+ <h4>Step 4: Verify installation</h4>
333
+ <p>Type this command to check if Pulp Image is installed correctly:</p>
334
+ <div class="example-block">
335
+ <code>pulp --help</code>
336
+ </div>
337
+ <p>You should see a list of available commands and options. If you see an error, the installation may not have completed successfully.</p>
338
+
339
+ <h4>Step 5: Run Pulp on your images</h4>
340
+ <p>Commands run in the folder where your images are located. Here's how to use it:</p>
341
+ <div class="example-block">
342
+ <code>cd Desktop/photos<br>pulp .</code>
343
+ </div>
344
+ <p>Explanation:</p>
345
+ <ul>
346
+ <li><code>cd</code> changes directory (folder) - replace "Desktop/photos" with the path to your images</li>
347
+ <li><code>.</code> means "current folder" - this processes all supported images in that folder</li>
348
+ </ul>
349
+ <p>You can also process a single file:</p>
350
+ <div class="example-block">
351
+ <code>pulp image.png --format webp</code>
352
+ </div>
353
+ </div>
354
+
355
+ <h2>CLI Reference</h2>
356
+ <p>This UI maps directly to CLI commands. Here's how each option translates:</p>
357
+
358
+ <div class="help-mapping">
359
+ <h3>UI Option → CLI Flag</h3>
360
+ <table class="help-table">
361
+ <tr><td><strong>Input Source</strong></td><td><code>pulp [input]</code></td></tr>
362
+ <tr><td><strong>Output Directory</strong></td><td><code>--out &lt;dir&gt;</code></td></tr>
363
+ <tr><td><strong>Format</strong></td><td><code>--format &lt;format&gt;</code></td></tr>
364
+ <tr><td><strong>Width</strong></td><td><code>--width &lt;number&gt;</code></td></tr>
365
+ <tr><td><strong>Height</strong></td><td><code>--height &lt;number&gt;</code></td></tr>
366
+ <tr><td><strong>Quality</strong></td><td><code>--quality &lt;number&gt;</code></td></tr>
367
+ <tr><td><strong>Lossless</strong></td><td><code>--lossless</code></td></tr>
368
+ <tr><td><strong>Alpha Mode</strong></td><td><code>--alpha-mode &lt;mode&gt;</code></td></tr>
369
+ <tr><td><strong>Background Color</strong></td><td><code>--background &lt;color&gt;</code></td></tr>
370
+ <tr><td><strong>Rename Pattern</strong></td><td><code>--rename-pattern &lt;pattern&gt;</code> (UI only)</td></tr>
371
+ <tr><td><strong>Custom Suffix</strong></td><td><code>--suffix &lt;text&gt;</code></td></tr>
372
+ <tr><td><strong>Auto Suffix</strong></td><td><code>--auto-suffix</code></td></tr>
373
+ <tr><td><strong>Overwrite</strong></td><td><code>--overwrite</code></td></tr>
374
+ <tr><td><strong>Delete Original</strong></td><td><code>--delete-original</code> (CLI only)</td></tr>
375
+ </table>
376
+ </div>
377
+
378
+ <div class="help-examples">
379
+ <h3>CLI Examples</h3>
380
+ <div class="example-block">
381
+ <code>pulp image.png --format webp --quality 95</code>
382
+ <p>Convert PNG to WebP with high quality</p>
383
+ </div>
384
+ <div class="example-block">
385
+ <code>pulp image.png --width 800</code>
386
+ <p>Resize to 800px width (preserves aspect ratio)</p>
387
+ </div>
388
+ <div class="example-block">
389
+ <code>pulp image.png --format webp --out ./output</code>
390
+ <p>Convert and save to custom output directory</p>
391
+ </div>
392
+ <div class="example-block">
393
+ <code>pulp image.png --width 800 --height 600 --auto-suffix</code>
394
+ <p>Resize to exact dimensions with auto suffix</p>
395
+ </div>
396
+ <div class="example-block">
397
+ <code>pulp ./images --format webp --out ./output --verbose</code>
398
+ <p>Process entire directory with verbose output</p>
399
+ </div>
400
+ <div class="example-block">
401
+ <code>pulp image.png --format jpg --background "#ff0000"</code>
402
+ <p>Convert PNG with transparency to JPG with red background</p>
403
+ </div>
404
+ <div class="example-block">
405
+ <code>pulp image.png --format avif --quality 70</code>
406
+ <p>Convert to AVIF with custom quality</p>
407
+ </div>
408
+ <div class="example-block">
409
+ <code>pulp ./images --width 800 --auto-suffix --suffix "thumb" --out ./pulp-image-results</code>
410
+ <p>Process directory with resize, auto suffix, and custom suffix</p>
411
+ </div>
412
+ </div>
413
+
414
+ <div class="help-info">
415
+ <h3>When to Use CLI vs UI</h3>
416
+ <p><strong>Use CLI when:</strong></p>
417
+ <ul>
418
+ <li>Automating workflows or scripts</li>
419
+ <li>Processing large batches from command line</li>
420
+ <li>Integrating with other tools</li>
421
+ <li>You need to delete original files after processing (CLI only)</li>
422
+ <li>You're comfortable with command line</li>
423
+ </ul>
424
+ <p><strong>Use UI when:</strong></p>
425
+ <ul>
426
+ <li>You're new to the tool</li>
427
+ <li>You want visual feedback and guidance</li>
428
+ <li>You need to understand option combinations</li>
429
+ <li>You want to keep your original files safe (UI processes copies)</li>
430
+ <li>You prefer point-and-click interfaces</li>
431
+ </ul>
432
+ </div>
433
+
434
+ <div class="help-info">
435
+ <h3>Rename Patterns</h3>
436
+ <p>The UI supports rename patterns for flexible output filename generation. This is a UI helper feature that maps to output naming.</p>
437
+ <p>The rename pattern fully controls the output filename. <code>{name}</code> is optional and can be omitted.</p>
438
+ <p><strong>Supported tokens:</strong></p>
439
+ <ul>
440
+ <li><code>{name}</code> - Original basename (without extension)</li>
441
+ <li><code>{ext}</code> - Output extension (without leading dot)</li>
442
+ <li><code>{index}</code> - 1-based index in batch (useful for sequential naming)</li>
443
+ </ul>
444
+ <p><strong>Examples:</strong></p>
445
+ <ul>
446
+ <li><code>{name}-optimized.{ext}</code> - Adds "-optimized" suffix</li>
447
+ <li><code>{index}-{name}.{ext}</code> - Prefixes with sequential number</li>
448
+ <li><code>thumb-{name}.{ext}</code> - Prefixes all files with "thumb-"</li>
449
+ <li><code>{name}_web.{ext}</code> - Adds "_web" suffix</li>
450
+ </ul>
451
+ <p><strong>Full filename replacement example:</strong></p>
452
+ <p><code>{index}-cute-animal.{ext}</code><br>
453
+ → <code>1-cute-animal.webp</code>, <code>2-cute-animal.webp</code>, <code>3-cute-animal.webp</code></p>
454
+ <p><em>Note: If no extension is included in the pattern, the output extension will be automatically appended.</em></p>
455
+ </div>
456
+
457
+ <div class="help-info">
458
+ <h3>Compression Behavior</h3>
459
+ <ul>
460
+ <li><strong>PNG:</strong> Always lossless (no quality setting)</li>
461
+ <li><strong>JPG:</strong> Always lossy, default quality 80 (does not support lossless)</li>
462
+ <li><strong>WebP:</strong> Lossy by default (quality 80), use lossless for lossless</li>
463
+ <li><strong>AVIF:</strong> Lossy by default (quality 50), use lossless for lossless</li>
464
+ </ul>
465
+ <p><em>Note: Resize does not affect compression - it only changes dimensions.</em></p>
466
+ </div>
467
+ </div>
468
+ </div>
469
+ </main>
470
+ </div>
471
+
472
+ <script src="app.js"></script>
473
+ </body>
474
+ </html>
475
+