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/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 ~ for home directory.
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
- <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>
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
- <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>
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
- <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>
303
+ <!-- Compression Behavior -->
315
304
 
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>
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
- <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>
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
- <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>
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
- <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>
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
- <p>You should see a list of available commands and options. If you see an error, the installation may not have completed successfully.</p>
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
- <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>
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
- </div>
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
- <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>
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><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>
489
+ <thead><tr><th>Option</th><th>Description</th><th>Default</th></tr></thead>
490
+ <tbody>
491
+ <tr>
492
+ <td><code>-w, --width &lt;number&gt;</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 &lt;number&gt;</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 &lt;format&gt;</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 &lt;dir&gt;</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 &lt;number&gt;</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 &lt;text&gt;</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 &lt;color&gt;</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 &lt;mode&gt;</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
- </div>
568
+ </section>
377
569
 
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>
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
- <div class="example-block">
385
- <code>pulp image.png --width 800</code>
386
- <p>Resize to 800px width (preserves aspect ratio)</p>
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
- <div class="example-block">
389
- <code>pulp image.png --format webp --out ./output</code>
390
- <p>Convert and save to custom output directory</p>
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
- <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>
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
- <div class="example-block">
397
- <code>pulp ./images --format webp --out ./output --verbose</code>
398
- <p>Process entire directory with verbose output</p>
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
- <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>
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
- <div class="example-block">
405
- <code>pulp image.png --format avif --quality 70</code>
406
- <p>Convert to AVIF with custom quality</p>
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
- <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>
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
- </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>
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
- <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>
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