pulp-image 0.1.6 → 0.1.7
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.
- package/package.json +1 -1
- package/src/uiServer.js +15 -9
- package/ui/app.js +148 -9
- package/ui/index.html +551 -158
- package/ui/styles.css +289 -6
package/ui/index.html
CHANGED
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<label for="output-dir" class="form-label">
|
|
89
89
|
Output Directory
|
|
90
90
|
</label>
|
|
91
|
-
<input type="text" id="output-dir" class="text-input" readonly>
|
|
91
|
+
<input type="text" id="output-dir" class="text-input" readonly placeholder="~/my-images or full path">
|
|
92
92
|
<div class="input-helper" id="output-dir-helper">
|
|
93
93
|
Files will be saved in a new folder inside your home directory.
|
|
94
94
|
</div>
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<span class="checkbox-text">Use custom output directory</span>
|
|
103
103
|
</label>
|
|
104
104
|
<div class="input-helper">
|
|
105
|
-
When enabled, you can specify a custom output directory. Use
|
|
105
|
+
When enabled, you can specify a custom output directory. Use <code>~</code> as a shortcut for your home folder (e.g., <code>~/my-images</code>), or enter a full path.
|
|
106
106
|
</div>
|
|
107
107
|
</div>
|
|
108
108
|
</details>
|
|
@@ -284,188 +284,581 @@
|
|
|
284
284
|
<!-- Help Tab -->
|
|
285
285
|
<div class="tab-content" id="help-tab">
|
|
286
286
|
<div class="help-content">
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
<
|
|
290
|
-
|
|
287
|
+
<!-- Sub-Navigation -->
|
|
288
|
+
<nav class="help-subnav" id="help-subnav">
|
|
289
|
+
<a class="help-subnav-link" href="#help-compression">Formats / Compression</a>
|
|
290
|
+
<a class="help-subnav-link" href="#help-ui-options">UI Guide</a>
|
|
291
|
+
<a class="help-subnav-link" href="#help-install">Install CLI</a>
|
|
292
|
+
<a class="help-subnav-link" href="#help-reference">CLI Options</a>
|
|
293
|
+
<a class="help-subnav-link" href="#help-examples">Examples</a>
|
|
294
|
+
</nav>
|
|
291
295
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<
|
|
295
|
-
<
|
|
296
|
-
|
|
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>
|
|
296
|
+
<!-- Welcome -->
|
|
297
|
+
<div class="help-card" style="background: var(--orange-bg-light); margin-bottom: 1.5rem;">
|
|
298
|
+
<h4 class="help-card-title" style="font-size: 1.1rem; color: var(--orange-text);">Welcome to Pulp Image</h4>
|
|
299
|
+
<p class="help-card-text">This browser UI works fully offline. The CLI is optional for automation, advanced workflows, or if you prefer the terminal.</p>
|
|
300
|
+
<p class="help-card-text" style="margin-top: 0.5rem;">If you downloaded this UI as a portable package from the Pulp website, you don't need to install the CLI — it's already included. If you want to use the CLI separately, see the <a href="#help-install" style="color: var(--orange-text); font-weight: 600;">installation guide</a>.</p>
|
|
301
301
|
</div>
|
|
302
302
|
|
|
303
|
-
|
|
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>
|
|
303
|
+
<!-- Compression Behavior -->
|
|
315
304
|
|
|
316
|
-
|
|
317
|
-
<
|
|
318
|
-
<
|
|
319
|
-
<
|
|
320
|
-
<
|
|
321
|
-
|
|
322
|
-
|
|
305
|
+
<section id="help-compression">
|
|
306
|
+
<h2>Formats / Compression</h2>
|
|
307
|
+
<table class="help-table">
|
|
308
|
+
<thead><tr><th>Format</th><th>Transparency</th><th>Compression</th><th>Default Quality</th></tr></thead>
|
|
309
|
+
<tbody>
|
|
310
|
+
<tr><td><code>png</code></td><td>✓ Yes</td><td>Always lossless</td><td>—</td></tr>
|
|
311
|
+
<tr><td><code>jpg</code></td><td>✗ No</td><td>Always lossy</td><td>80</td></tr>
|
|
312
|
+
<tr><td><code>webp</code></td><td>✓ Yes</td><td>Lossy or lossless</td><td>80</td></tr>
|
|
313
|
+
<tr><td><code>avif</code></td><td>✓ Yes</td><td>Lossy or lossless</td><td>50</td></tr>
|
|
314
|
+
</tbody>
|
|
315
|
+
</table>
|
|
316
|
+
<p style="margin-top: 1rem; color: var(--text-secondary); font-size: 0.9rem;"><em>Note: Resize does not affect compression — it only changes dimensions.</em></p>
|
|
317
|
+
</section>
|
|
323
318
|
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
<
|
|
327
|
-
|
|
319
|
+
<!-- UI Options Guide -->
|
|
320
|
+
<section id="help-ui-options">
|
|
321
|
+
<h2>UI Options Guide</h2>
|
|
322
|
+
|
|
323
|
+
<div class="help-subsection">
|
|
324
|
+
<h3 class="help-subsection-title">Selecting Images</h3>
|
|
325
|
+
<p style="margin-bottom: 0.75rem;">Choose between <strong>Files</strong> (individual images) or <strong>Folder</strong> (all images in a directory). Supports drag-and-drop.</p>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<div class="help-subsection">
|
|
329
|
+
<h3 class="help-subsection-title">Output Directory</h3>
|
|
330
|
+
<p style="margin-bottom: 0.5rem;">Default: <code>~/pulp-image-results/[timestamp]/</code></p>
|
|
331
|
+
<p style="margin-bottom: 0.75rem;">Enable "Use custom output directory" to specify your own path. Use <code>~</code> for home directory.</p>
|
|
332
|
+
</div>
|
|
333
|
+
|
|
334
|
+
<div class="help-subsection">
|
|
335
|
+
<h3 class="help-subsection-title">Dimensions (Width & Height)</h3>
|
|
336
|
+
<table class="help-table">
|
|
337
|
+
<thead><tr><th>Setting</th><th>Result</th></tr></thead>
|
|
338
|
+
<tbody>
|
|
339
|
+
<tr><td>Width only</td><td>Height adjusts to preserve aspect ratio</td></tr>
|
|
340
|
+
<tr><td>Height only</td><td>Width adjusts to preserve aspect ratio</td></tr>
|
|
341
|
+
<tr><td>Both</td><td>Exact dimensions (may crop)</td></tr>
|
|
342
|
+
<tr><td>Neither</td><td>Original size (format/quality only)</td></tr>
|
|
343
|
+
</tbody>
|
|
344
|
+
</table>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
<div class="help-subsection">
|
|
348
|
+
<h3 class="help-subsection-title">Quality Slider</h3>
|
|
349
|
+
<p style="margin-bottom: 0.5rem;">Controls compression for JPG, WebP, AVIF (1-100). Disabled for PNG and when lossless is enabled.</p>
|
|
350
|
+
<table class="help-table">
|
|
351
|
+
<thead><tr><th>Range</th><th>Use Case</th></tr></thead>
|
|
352
|
+
<tbody>
|
|
353
|
+
<tr><td>90-100</td><td>Near-lossless, important photos</td></tr>
|
|
354
|
+
<tr><td>75-89</td><td>Good balance (recommended)</td></tr>
|
|
355
|
+
<tr><td>50-74</td><td>Thumbnails, previews</td></tr>
|
|
356
|
+
</tbody>
|
|
357
|
+
</table>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
<div class="help-subsection">
|
|
361
|
+
<h3 class="help-subsection-title">Alpha (Transparency)</h3>
|
|
362
|
+
<p style="margin-bottom: 0.5rem;">When converting to JPG (no transparency):</p>
|
|
363
|
+
<ul style="margin: 0 0 0 1.25rem; color: var(--text-secondary);">
|
|
364
|
+
<li><strong>Flatten</strong> — Fill transparent areas with background color</li>
|
|
365
|
+
<li><strong>Error</strong> — Fail if image has transparency</li>
|
|
366
|
+
</ul>
|
|
328
367
|
</div>
|
|
329
|
-
|
|
330
|
-
<
|
|
368
|
+
|
|
369
|
+
<div class="help-subsection">
|
|
370
|
+
<h3 class="help-subsection-title">Auto Suffix</h3>
|
|
371
|
+
<p style="margin-bottom: 0.5rem;">Adds dimensions to filename:</p>
|
|
372
|
+
<ul style="margin: 0 0 0 1.25rem; color: var(--text-secondary);">
|
|
373
|
+
<li>Width 800 → <code>photo-800w.webp</code></li>
|
|
374
|
+
<li>Height 600 → <code>photo-600h.webp</code></li>
|
|
375
|
+
<li>Both → <code>photo-800x600.webp</code></li>
|
|
376
|
+
</ul>
|
|
377
|
+
</div>
|
|
378
|
+
|
|
379
|
+
<div class="help-subsection">
|
|
380
|
+
<h3 class="help-subsection-title">Rename Patterns (UI Only)</h3>
|
|
381
|
+
<p style="margin-bottom: 0.5rem;">Flexible output filename generation. <em>CLI users already have shell tools for renaming that can be piped with Pulp.</em></p>
|
|
382
|
+
<p style="margin-bottom: 0.5rem;"><strong>Supported Tokens:</strong></p>
|
|
383
|
+
<ul style="margin: 0 0 1rem 1.25rem; color: var(--text-secondary);">
|
|
384
|
+
<li><code>{name}</code> — Original basename (without extension)</li>
|
|
385
|
+
<li><code>{ext}</code> — Output extension (without leading dot)</li>
|
|
386
|
+
<li><code>{index}</code> — 1-based index in batch</li>
|
|
387
|
+
</ul>
|
|
388
|
+
<table class="help-table">
|
|
389
|
+
<thead><tr><th>Pattern</th><th>Result</th></tr></thead>
|
|
390
|
+
<tbody>
|
|
391
|
+
<tr><td><code>{name}-optimized.{ext}</code></td><td>photo-optimized.webp</td></tr>
|
|
392
|
+
<tr><td><code>{index}-{name}.{ext}</code></td><td>1-photo.webp, 2-cat.webp</td></tr>
|
|
393
|
+
<tr><td><code>thumb-{name}.{ext}</code></td><td>thumb-photo.webp</td></tr>
|
|
394
|
+
<tr><td><code>image-{index}.{ext}</code></td><td>image-1.webp, image-2.webp</td></tr>
|
|
395
|
+
</tbody>
|
|
396
|
+
</table>
|
|
397
|
+
</div>
|
|
398
|
+
</section>
|
|
331
399
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
<
|
|
335
|
-
|
|
400
|
+
<!-- Tips -->
|
|
401
|
+
<section id="help-tips">
|
|
402
|
+
<h2>Tips & Best Practices</h2>
|
|
403
|
+
|
|
404
|
+
<div class="help-card">
|
|
405
|
+
<h4 class="help-card-title">🖼️ Web Images</h4>
|
|
406
|
+
<div class="help-card-text">WebP at quality 80-85. Great compression, modern browser support.</div>
|
|
407
|
+
</div>
|
|
408
|
+
|
|
409
|
+
<div class="help-card">
|
|
410
|
+
<h4 class="help-card-title">📱 Responsive Images</h4>
|
|
411
|
+
<div class="help-card-text">Process same images with different widths (400, 800, 1200) + Auto Suffix.</div>
|
|
336
412
|
</div>
|
|
337
|
-
|
|
413
|
+
|
|
414
|
+
<div class="help-card">
|
|
415
|
+
<h4 class="help-card-title">🎨 Graphics & Logos</h4>
|
|
416
|
+
<div class="help-card-text">PNG or WebP lossless to preserve sharp edges and text.</div>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
<div class="help-card">
|
|
420
|
+
<h4 class="help-card-title">📷 Photos</h4>
|
|
421
|
+
<div class="help-card-text">JPG 85-90 or WebP 80-85 for best size/quality balance.</div>
|
|
422
|
+
</div>
|
|
423
|
+
</section>
|
|
338
424
|
|
|
339
|
-
|
|
340
|
-
<
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
425
|
+
<section id="help-install">
|
|
426
|
+
<h2>Installing the CLI (Optional)</h2>
|
|
427
|
+
<p>The CLI is optional. Only install if you need automation, scripting, or CLI-only features like <code>--delete-original</code>.</p>
|
|
428
|
+
|
|
429
|
+
<div class="terminal-example">
|
|
430
|
+
<div class="terminal-example-header">
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
<span class="terminal-example-title">Install globally via npm (requires Node.js 18+)</span>
|
|
435
|
+
</div>
|
|
436
|
+
<div class="terminal-example-body" data-copy="npm install -g pulp-image">
|
|
437
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
438
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
439
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
440
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
441
|
+
</svg>
|
|
442
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
443
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
444
|
+
</svg>
|
|
445
|
+
</button>
|
|
446
|
+
<pre><span class="cmd">$</span> npm install -g pulp-image</pre>
|
|
447
|
+
</div>
|
|
352
448
|
</div>
|
|
353
|
-
|
|
449
|
+
|
|
450
|
+
<div class="terminal-example">
|
|
451
|
+
<div class="terminal-example-header">
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
<span class="terminal-example-title">Verify installation</span>
|
|
456
|
+
</div>
|
|
457
|
+
<div class="terminal-example-body" data-copy="pulp --version">
|
|
458
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
459
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
460
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
461
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
462
|
+
</svg>
|
|
463
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
464
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
465
|
+
</svg>
|
|
466
|
+
</button>
|
|
467
|
+
<pre><span class="cmd">$</span> pulp --version</pre>
|
|
468
|
+
</div>
|
|
469
|
+
</div>
|
|
470
|
+
|
|
471
|
+
<div class="help-card">
|
|
472
|
+
<h4 class="help-card-title">Don't have Node.js?</h4>
|
|
473
|
+
<div class="help-card-text">
|
|
474
|
+
Download from <a href="https://nodejs.org" target="_blank" rel="noopener" style="color: var(--orange-text);">nodejs.org</a> (LTS version). After installing, open a terminal:
|
|
475
|
+
<ul style="margin: 0.5rem 0 0 1.25rem;">
|
|
476
|
+
<li><strong>macOS:</strong> Press <kbd>Cmd + Space</kbd>, type "Terminal"</li>
|
|
477
|
+
<li><strong>Windows:</strong> Search "PowerShell" or "Command Prompt"</li>
|
|
478
|
+
<li><strong>Linux:</strong> Open your terminal application</li>
|
|
479
|
+
</ul>
|
|
480
|
+
</div>
|
|
481
|
+
</div>
|
|
482
|
+
</section>
|
|
354
483
|
|
|
355
|
-
<
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
<h3>UI Option → CLI Flag</h3>
|
|
484
|
+
<section id="help-reference">
|
|
485
|
+
<h2>CLI Options</h2>
|
|
486
|
+
<p>Complete reference for all CLI options:</p>
|
|
487
|
+
|
|
360
488
|
<table class="help-table">
|
|
361
|
-
<tr><
|
|
362
|
-
<
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
489
|
+
<thead><tr><th>Option</th><th>Description</th><th>Default</th></tr></thead>
|
|
490
|
+
<tbody>
|
|
491
|
+
<tr>
|
|
492
|
+
<td><code>-w, --width <number></code></td>
|
|
493
|
+
<td>Output width in pixels. Aspect ratio is preserved if height is not specified.</td>
|
|
494
|
+
<td>—</td>
|
|
495
|
+
</tr>
|
|
496
|
+
<tr>
|
|
497
|
+
<td><code>-h, --height <number></code></td>
|
|
498
|
+
<td>Output height in pixels. Aspect ratio is preserved if width is not specified.</td>
|
|
499
|
+
<td>—</td>
|
|
500
|
+
</tr>
|
|
501
|
+
<tr>
|
|
502
|
+
<td><code>-f, --format <format></code></td>
|
|
503
|
+
<td>Output format: <code>png</code>, <code>jpg</code>, <code>webp</code>, or <code>avif</code></td>
|
|
504
|
+
<td>Same as input</td>
|
|
505
|
+
</tr>
|
|
506
|
+
<tr>
|
|
507
|
+
<td><code>-o, --out <dir></code></td>
|
|
508
|
+
<td>Output directory. Created automatically if it doesn't exist.</td>
|
|
509
|
+
<td><code>./pulp-image-results</code></td>
|
|
510
|
+
</tr>
|
|
511
|
+
<tr>
|
|
512
|
+
<td><code>--quality <number></code></td>
|
|
513
|
+
<td>Quality for lossy formats (1-100). Higher = better quality, larger file.</td>
|
|
514
|
+
<td>JPG: 80, WebP: 80, AVIF: 50</td>
|
|
515
|
+
</tr>
|
|
516
|
+
<tr>
|
|
517
|
+
<td><code>--lossless</code></td>
|
|
518
|
+
<td>Use lossless compression for WebP and AVIF. PNG is always lossless.</td>
|
|
519
|
+
<td>Off (lossy)</td>
|
|
520
|
+
</tr>
|
|
521
|
+
<tr>
|
|
522
|
+
<td><code>--suffix <text></code></td>
|
|
523
|
+
<td>Custom suffix added before file extension. E.g., "optimized" → image-optimized.png</td>
|
|
524
|
+
<td>—</td>
|
|
525
|
+
</tr>
|
|
526
|
+
<tr>
|
|
527
|
+
<td><code>--auto-suffix</code></td>
|
|
528
|
+
<td>Automatically add size-based suffix: <code>-800w</code>, <code>-600h</code>, or <code>-800x600</code></td>
|
|
529
|
+
<td>Off</td>
|
|
530
|
+
</tr>
|
|
531
|
+
<tr>
|
|
532
|
+
<td><code>--background <color></code></td>
|
|
533
|
+
<td>Background color (hex) for transparency flattening when converting to JPG.</td>
|
|
534
|
+
<td><code>#ffffff</code></td>
|
|
535
|
+
</tr>
|
|
536
|
+
<tr>
|
|
537
|
+
<td><code>--alpha-mode <mode></code></td>
|
|
538
|
+
<td>How to handle transparency: <code>flatten</code> (composite onto background) or <code>error</code> (fail if present)</td>
|
|
539
|
+
<td><code>flatten</code></td>
|
|
540
|
+
</tr>
|
|
541
|
+
<tr>
|
|
542
|
+
<td><code>--overwrite</code></td>
|
|
543
|
+
<td>Overwrite existing output files. By default, existing files are skipped.</td>
|
|
544
|
+
<td>Off (skip)</td>
|
|
545
|
+
</tr>
|
|
546
|
+
<tr>
|
|
547
|
+
<td><code>--delete-original</code></td>
|
|
548
|
+
<td>Delete original files after successful processing. Only works if input/output paths differ. <em>(CLI only)</em></td>
|
|
549
|
+
<td>Off</td>
|
|
550
|
+
</tr>
|
|
551
|
+
<tr>
|
|
552
|
+
<td><code>-v, --verbose</code></td>
|
|
553
|
+
<td>Show detailed per-file processing information. <em>(CLI only)</em></td>
|
|
554
|
+
<td>Off</td>
|
|
555
|
+
</tr>
|
|
556
|
+
<tr>
|
|
557
|
+
<td><code>--version</code></td>
|
|
558
|
+
<td>Display version number.</td>
|
|
559
|
+
<td>—</td>
|
|
560
|
+
</tr>
|
|
561
|
+
<tr>
|
|
562
|
+
<td><code>--help</code></td>
|
|
563
|
+
<td>Display help information.</td>
|
|
564
|
+
<td>—</td>
|
|
565
|
+
</tr>
|
|
566
|
+
</tbody>
|
|
375
567
|
</table>
|
|
376
|
-
</
|
|
568
|
+
</section>
|
|
377
569
|
|
|
378
|
-
<
|
|
379
|
-
<
|
|
380
|
-
<
|
|
381
|
-
|
|
382
|
-
|
|
570
|
+
<section id="help-examples">
|
|
571
|
+
<h2>Quick Examples</h2>
|
|
572
|
+
<p style="margin-bottom: 1rem;">Click to copy any command:</p>
|
|
573
|
+
|
|
574
|
+
<div class="terminal-example">
|
|
575
|
+
<div class="terminal-example-header">
|
|
576
|
+
<span class="terminal-example-title">Convert to WebP</span>
|
|
577
|
+
</div>
|
|
578
|
+
<div class="terminal-example-body" data-copy="pulp image.png --format webp">
|
|
579
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
580
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
581
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
582
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
583
|
+
</svg>
|
|
584
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
585
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
586
|
+
</svg>
|
|
587
|
+
</button>
|
|
588
|
+
<pre><span class="cmd">$</span> pulp image.png <span class="flag">--format</span> <span class="value">webp</span></pre>
|
|
589
|
+
</div>
|
|
383
590
|
</div>
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
<
|
|
591
|
+
|
|
592
|
+
<div class="terminal-example">
|
|
593
|
+
<div class="terminal-example-header">
|
|
594
|
+
<span class="terminal-example-title">Resize to 800px width</span>
|
|
595
|
+
</div>
|
|
596
|
+
<div class="terminal-example-body" data-copy="pulp image.png --width 800">
|
|
597
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
598
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
599
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
600
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
601
|
+
</svg>
|
|
602
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
603
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
604
|
+
</svg>
|
|
605
|
+
</button>
|
|
606
|
+
<pre><span class="cmd">$</span> pulp image.png <span class="flag">--width</span> <span class="value">800</span>
|
|
607
|
+
<span class="comment"># Height adjusts to preserve aspect ratio</span></pre>
|
|
608
|
+
</div>
|
|
387
609
|
</div>
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
<
|
|
610
|
+
|
|
611
|
+
<div class="terminal-example">
|
|
612
|
+
<div class="terminal-example-header">
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
<span class="terminal-example-title">Batch convert a folder</span>
|
|
617
|
+
</div>
|
|
618
|
+
<div class="terminal-example-body" data-copy="pulp ./images --format webp --out ./output">
|
|
619
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
620
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
621
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
622
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
623
|
+
</svg>
|
|
624
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
625
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
626
|
+
</svg>
|
|
627
|
+
</button>
|
|
628
|
+
<pre><span class="cmd">$</span> pulp <span class="value">./images</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--out</span> <span class="value">./output</span>
|
|
629
|
+
|
|
630
|
+
<span class="success">✓</span> <span class="output">Processed 12 file(s)</span>
|
|
631
|
+
<span class="output">Saved:</span> <span class="success">39.8 MB (82%)</span></pre>
|
|
632
|
+
</div>
|
|
391
633
|
</div>
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
<
|
|
634
|
+
|
|
635
|
+
<div class="terminal-example">
|
|
636
|
+
<div class="terminal-example-header">
|
|
637
|
+
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
<span class="terminal-example-title">Convert to AVIF with quality</span>
|
|
641
|
+
</div>
|
|
642
|
+
<div class="terminal-example-body" data-copy="pulp image.png --format avif --quality 70">
|
|
643
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
644
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
645
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
646
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
647
|
+
</svg>
|
|
648
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
649
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
650
|
+
</svg>
|
|
651
|
+
</button>
|
|
652
|
+
<pre><span class="cmd">$</span> pulp image.png <span class="flag">--format</span> <span class="value">avif</span> <span class="flag">--quality</span> <span class="value">70</span></pre>
|
|
653
|
+
</div>
|
|
395
654
|
</div>
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
<
|
|
655
|
+
|
|
656
|
+
<div class="terminal-example">
|
|
657
|
+
<div class="terminal-example-header">
|
|
658
|
+
|
|
659
|
+
|
|
660
|
+
|
|
661
|
+
<span class="terminal-example-title">Flatten transparency to JPG</span>
|
|
662
|
+
</div>
|
|
663
|
+
<div class="terminal-example-body" data-copy='pulp logo.png --format jpg --background "#ff6b35"'>
|
|
664
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
665
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
666
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
667
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
668
|
+
</svg>
|
|
669
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
670
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
671
|
+
</svg>
|
|
672
|
+
</button>
|
|
673
|
+
<pre><span class="cmd">$</span> pulp logo.png <span class="flag">--format</span> <span class="value">jpg</span> <span class="flag">--background</span> <span class="value">"#ff6b35"</span>
|
|
674
|
+
<span class="comment"># Transparent areas become orange</span></pre>
|
|
675
|
+
</div>
|
|
399
676
|
</div>
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
<
|
|
677
|
+
|
|
678
|
+
<div class="terminal-example">
|
|
679
|
+
<div class="terminal-example-header">
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
<span class="terminal-example-title">Batch resize with auto-suffix</span>
|
|
684
|
+
</div>
|
|
685
|
+
<div class="terminal-example-body" data-copy="pulp ./images --width 800 --auto-suffix --format webp">
|
|
686
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
687
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
688
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
689
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
690
|
+
</svg>
|
|
691
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
692
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
693
|
+
</svg>
|
|
694
|
+
</button>
|
|
695
|
+
<pre><span class="cmd">$</span> pulp <span class="value">./images</span> <span class="flag">--width</span> <span class="value">800</span> <span class="flag">--auto-suffix</span> <span class="flag">--format</span> <span class="value">webp</span>
|
|
696
|
+
<span class="comment"># Output: photo-800w.webp</span></pre>
|
|
697
|
+
</div>
|
|
403
698
|
</div>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
699
|
+
</section>
|
|
700
|
+
|
|
701
|
+
<section id="help-advanced">
|
|
702
|
+
<h2>Advanced Examples</h2>
|
|
703
|
+
|
|
704
|
+
<div class="help-subsection">
|
|
705
|
+
<h3 class="help-subsection-title">Web Optimization</h3>
|
|
706
|
+
<div class="terminal-example">
|
|
707
|
+
<div class="terminal-example-header">
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
|
|
711
|
+
<span class="terminal-example-title">Optimize assets for web deployment</span>
|
|
712
|
+
</div>
|
|
713
|
+
<div class="terminal-example-body" data-copy="pulp ./assets --format webp --quality 85 --out ./public/images">
|
|
714
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
715
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
716
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
717
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
718
|
+
</svg>
|
|
719
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
720
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
721
|
+
</svg>
|
|
722
|
+
</button>
|
|
723
|
+
<pre><span class="cmd">$</span> pulp <span class="value">./assets</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--quality</span> <span class="value">85</span> <span class="flag">--out</span> <span class="value">./public/images</span></pre>
|
|
724
|
+
</div>
|
|
725
|
+
</div>
|
|
407
726
|
</div>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
<
|
|
727
|
+
|
|
728
|
+
<div class="help-subsection">
|
|
729
|
+
<h3 class="help-subsection-title">Responsive Images</h3>
|
|
730
|
+
<div class="terminal-example">
|
|
731
|
+
<div class="terminal-example-header">
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
<span class="terminal-example-title">Generate multiple sizes for srcset</span>
|
|
736
|
+
</div>
|
|
737
|
+
<div class="terminal-example-body">
|
|
738
|
+
<pre><span class="comment"># Run multiple times with different widths:</span>
|
|
739
|
+
<span class="cmd">$</span> pulp <span class="value">./photos</span> <span class="flag">--width</span> <span class="value">400</span> <span class="flag">--auto-suffix</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--out</span> <span class="value">./responsive</span>
|
|
740
|
+
<span class="cmd">$</span> pulp <span class="value">./photos</span> <span class="flag">--width</span> <span class="value">800</span> <span class="flag">--auto-suffix</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--out</span> <span class="value">./responsive</span>
|
|
741
|
+
<span class="cmd">$</span> pulp <span class="value">./photos</span> <span class="flag">--width</span> <span class="value">1200</span> <span class="flag">--auto-suffix</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--out</span> <span class="value">./responsive</span>
|
|
742
|
+
<span class="comment"># Creates: photo-400w.webp, photo-800w.webp, photo-1200w.webp</span></pre>
|
|
743
|
+
</div>
|
|
744
|
+
</div>
|
|
411
745
|
</div>
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
746
|
+
|
|
747
|
+
<div class="help-subsection">
|
|
748
|
+
<h3 class="help-subsection-title">Social Media</h3>
|
|
749
|
+
<div class="terminal-example">
|
|
750
|
+
<div class="terminal-example-header">
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
|
|
754
|
+
<span class="terminal-example-title">Create Open Graph / Twitter card image</span>
|
|
755
|
+
</div>
|
|
756
|
+
<div class="terminal-example-body" data-copy='pulp cover.png --format jpg --quality 90 --width 1200 --height 630 --background "#ffffff"'>
|
|
757
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
758
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
759
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
760
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
761
|
+
</svg>
|
|
762
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
763
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
764
|
+
</svg>
|
|
765
|
+
</button>
|
|
766
|
+
<pre><span class="cmd">$</span> pulp cover.png <span class="flag">--format</span> <span class="value">jpg</span> <span class="flag">--quality</span> <span class="value">90</span> \
|
|
767
|
+
<span class="flag">--width</span> <span class="value">1200</span> <span class="flag">--height</span> <span class="value">630</span> <span class="flag">--background</span> <span class="value">"#ffffff"</span></pre>
|
|
768
|
+
</div>
|
|
769
|
+
</div>
|
|
770
|
+
</div>
|
|
771
|
+
|
|
772
|
+
<div class="help-subsection">
|
|
773
|
+
<h3 class="help-subsection-title">CI/CD Pipeline</h3>
|
|
774
|
+
<div class="terminal-example">
|
|
775
|
+
<div class="terminal-example-header">
|
|
776
|
+
|
|
777
|
+
|
|
778
|
+
|
|
779
|
+
<span class="terminal-example-title">Build script optimization</span>
|
|
780
|
+
</div>
|
|
781
|
+
<div class="terminal-example-body" data-copy="pulp ./src/images --format webp --quality 80 --out ./dist/images --overwrite">
|
|
782
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
783
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
784
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
785
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
786
|
+
</svg>
|
|
787
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
788
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
789
|
+
</svg>
|
|
790
|
+
</button>
|
|
791
|
+
<pre><span class="cmd">$</span> pulp <span class="value">./src/images</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--quality</span> <span class="value">80</span> \
|
|
792
|
+
<span class="flag">--out</span> <span class="value">./dist/images</span> <span class="flag">--overwrite</span>
|
|
793
|
+
<span class="comment"># Overwrites on each build for fresh output</span></pre>
|
|
794
|
+
</div>
|
|
795
|
+
</div>
|
|
796
|
+
</div>
|
|
797
|
+
|
|
798
|
+
<div class="help-subsection">
|
|
799
|
+
<h3 class="help-subsection-title">Delete Originals (CLI Only)</h3>
|
|
800
|
+
<div class="terminal-example">
|
|
801
|
+
<div class="terminal-example-header">
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+
<span class="terminal-example-title">Convert and remove originals</span>
|
|
806
|
+
</div>
|
|
807
|
+
<div class="terminal-example-body" data-copy="pulp ./images --format webp --out ./converted --delete-original">
|
|
808
|
+
<button class="terminal-example-copy" aria-label="Copy command">
|
|
809
|
+
<svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
810
|
+
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
|
|
811
|
+
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
|
|
812
|
+
</svg>
|
|
813
|
+
<svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="display: none;">
|
|
814
|
+
<polyline points="20 6 9 17 4 12"/>
|
|
815
|
+
</svg>
|
|
816
|
+
</button>
|
|
817
|
+
<pre><span class="cmd">$</span> pulp <span class="value">./images</span> <span class="flag">--format</span> <span class="value">webp</span> <span class="flag">--out</span> <span class="value">./converted</span> <span class="flag">--delete-original</span>
|
|
818
|
+
<span class="comment"># ⚠️ Original files are permanently deleted after processing</span></pre>
|
|
819
|
+
</div>
|
|
820
|
+
</div>
|
|
821
|
+
</div>
|
|
822
|
+
</section>
|
|
433
823
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
<
|
|
437
|
-
|
|
438
|
-
<
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
824
|
+
<!-- When to Use CLI vs UI -->
|
|
825
|
+
<section id="help-when-to-use">
|
|
826
|
+
<h2>When to Use CLI vs UI</h2>
|
|
827
|
+
|
|
828
|
+
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
|
|
829
|
+
<div class="help-card">
|
|
830
|
+
<h4 class="help-card-title">Use CLI when:</h4>
|
|
831
|
+
<ul class="help-card-text" style="margin: 0; padding-left: 1.25rem;">
|
|
832
|
+
<li>Automating workflows or scripts</li>
|
|
833
|
+
<li>Processing large batches from command line</li>
|
|
834
|
+
<li>Integrating with other tools</li>
|
|
835
|
+
<li>You need to delete original files (CLI only)</li>
|
|
836
|
+
<li>You're comfortable with command line</li>
|
|
837
|
+
</ul>
|
|
838
|
+
</div>
|
|
839
|
+
|
|
840
|
+
<div class="help-card">
|
|
841
|
+
<h4 class="help-card-title">Use UI when:</h4>
|
|
842
|
+
<ul class="help-card-text" style="margin: 0; padding-left: 1.25rem;">
|
|
843
|
+
<li>You're new to the tool</li>
|
|
844
|
+
<li>You want visual feedback and guidance</li>
|
|
845
|
+
<li>You need to understand option combinations</li>
|
|
846
|
+
<li>You want to keep originals safe (UI processes copies)</li>
|
|
847
|
+
<li>You prefer point-and-click interfaces</li>
|
|
848
|
+
</ul>
|
|
849
|
+
</div>
|
|
850
|
+
</div>
|
|
851
|
+
</section>
|
|
456
852
|
|
|
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
853
|
</div>
|
|
468
854
|
</div>
|
|
855
|
+
|
|
856
|
+
<!-- Back to Top Button (works for both tabs) -->
|
|
857
|
+
<button class="back-to-top" id="back-to-top" aria-label="Back to top">
|
|
858
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
859
|
+
<polyline points="18 15 12 9 6 15"/>
|
|
860
|
+
</svg>
|
|
861
|
+
</button>
|
|
469
862
|
</main>
|
|
470
863
|
</div>
|
|
471
864
|
|