@clypra-studio/engine 1.8.0 → 1.9.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.
package/dist/index.cjs CHANGED
@@ -31,7 +31,6 @@ __export(index_exports, {
31
31
  CANONICAL_RENDERER_VERSION: () => CANONICAL_RENDERER_VERSION,
32
32
  CANONICAL_SCHEMA_VERSION: () => CANONICAL_SCHEMA_VERSION,
33
33
  COMPOSITION_PRESETS: () => COMPOSITION_PRESETS,
34
- CameraEffects: () => camera_exports,
35
34
  CanvasDevice: () => CanvasDevice,
36
35
  CommandBufferBuilder: () => CommandBufferBuilder,
37
36
  CommandExecutor: () => CommandExecutor,
@@ -83,7 +82,6 @@ __export(index_exports, {
83
82
  LOTTIE_TEMPLATE_PRESETS: () => LOTTIE_TEMPLATE_PRESETS,
84
83
  LayerAnimationSchema: () => LayerAnimationSchema,
85
84
  LayoutEngine: () => LayoutEngine,
86
- LightEffects: () => light_exports,
87
85
  LiveBroadcastBridge: () => LiveBroadcastBridge,
88
86
  MediaEncoderRegistry: () => MediaEncoderRegistry,
89
87
  MediaImageEngine: () => MediaImageEngine,
@@ -2547,7 +2545,204 @@ function createBlankTextEffectConfig() {
2547
2545
  }))
2548
2546
  };
2549
2547
  }
2550
- var builtInPresets = [];
2548
+ var builtInPresets = [
2549
+ {
2550
+ id: "classic-yellow",
2551
+ name: "Classic Yellow",
2552
+ category: "caption",
2553
+ config: {
2554
+ ...defaultConfig,
2555
+ text: "SAMPLE CAPTION",
2556
+ effectName: "Classic Yellow",
2557
+ fontFamily: "Outfit Variable",
2558
+ fontWeight: 800,
2559
+ fontSize: 64,
2560
+ fillColor: "#FFE600",
2561
+ strokeEnabled: true,
2562
+ strokeColor: "#000000",
2563
+ strokeWidth: 5,
2564
+ strokePosition: "outside",
2565
+ strokeOpacity: 100,
2566
+ shadowEnabled: true,
2567
+ shadowColor: "#000000",
2568
+ shadowBlur: 6,
2569
+ shadowOffsetX: 0,
2570
+ shadowOffsetY: 3,
2571
+ shadowOpacity: 85
2572
+ }
2573
+ },
2574
+ {
2575
+ id: "dark-pill",
2576
+ name: "Dark Pill",
2577
+ category: "caption",
2578
+ config: {
2579
+ ...defaultConfig,
2580
+ text: "SAMPLE CAPTION",
2581
+ effectName: "Dark Pill",
2582
+ fontFamily: "Inter Variable",
2583
+ fontWeight: 700,
2584
+ fontSize: 56,
2585
+ fillColor: "#FFFFFF",
2586
+ panelEnabled: true,
2587
+ panelColor: "#000000",
2588
+ panelOpacity: 85,
2589
+ panelRadius: 28,
2590
+ panelPaddingX: 36,
2591
+ panelPaddingY: 12
2592
+ }
2593
+ },
2594
+ {
2595
+ id: "outline-white",
2596
+ name: "Outline White",
2597
+ category: "caption",
2598
+ config: {
2599
+ ...defaultConfig,
2600
+ text: "SAMPLE CAPTION",
2601
+ effectName: "Outline White",
2602
+ fontFamily: "Outfit Variable",
2603
+ fontWeight: 800,
2604
+ fontSize: 64,
2605
+ fillColor: "#FFFFFF",
2606
+ strokeEnabled: true,
2607
+ strokeColor: "#000000",
2608
+ strokeWidth: 4,
2609
+ strokePosition: "outside",
2610
+ strokeOpacity: 100,
2611
+ shadowEnabled: true,
2612
+ shadowColor: "#000000",
2613
+ shadowBlur: 4,
2614
+ shadowOffsetX: 0,
2615
+ shadowOffsetY: 2,
2616
+ shadowOpacity: 70
2617
+ }
2618
+ },
2619
+ {
2620
+ id: "neon-pop",
2621
+ name: "Neon Pop",
2622
+ category: "caption",
2623
+ config: {
2624
+ ...defaultConfig,
2625
+ text: "SAMPLE CAPTION",
2626
+ effectName: "Neon Pop",
2627
+ fontFamily: "Montserrat Variable",
2628
+ fontWeight: 800,
2629
+ fontSize: 64,
2630
+ fillColor: "#00F0FF",
2631
+ strokeEnabled: true,
2632
+ strokeColor: "#003344",
2633
+ strokeWidth: 2,
2634
+ strokePosition: "outside",
2635
+ glowLayers: [
2636
+ { enabled: true, color: "#00F0FF", blur: 15, opacity: 85, type: "outer" },
2637
+ { enabled: false, color: "#FF007C", blur: 40, opacity: 60, type: "outer" },
2638
+ { enabled: false, color: "#00F0FF", blur: 60, opacity: 40, type: "outer" }
2639
+ ],
2640
+ shadowEnabled: true,
2641
+ shadowColor: "rgba(0, 240, 255, 0.5)",
2642
+ shadowBlur: 14,
2643
+ shadowOffsetX: 0,
2644
+ shadowOffsetY: 0,
2645
+ shadowOpacity: 80
2646
+ }
2647
+ },
2648
+ {
2649
+ id: "minimal-clean",
2650
+ name: "Minimal Clean",
2651
+ category: "caption",
2652
+ config: {
2653
+ ...defaultConfig,
2654
+ text: "SAMPLE CAPTION",
2655
+ effectName: "Minimal Clean",
2656
+ fontFamily: "Inter Variable",
2657
+ fontWeight: 600,
2658
+ fontSize: 58,
2659
+ fillColor: "#F5F5F7",
2660
+ shadowEnabled: true,
2661
+ shadowColor: "#000000",
2662
+ shadowBlur: 6,
2663
+ shadowOffsetX: 0,
2664
+ shadowOffsetY: 2,
2665
+ shadowOpacity: 65
2666
+ }
2667
+ },
2668
+ {
2669
+ id: "fire-orange",
2670
+ name: "Fire Orange",
2671
+ category: "caption",
2672
+ config: {
2673
+ ...defaultConfig,
2674
+ text: "SAMPLE CAPTION",
2675
+ effectName: "Fire Orange",
2676
+ fontFamily: "Outfit Variable",
2677
+ fontWeight: 900,
2678
+ fontSize: 64,
2679
+ fillColor: "#FF5722",
2680
+ strokeEnabled: true,
2681
+ strokeColor: "#1A0500",
2682
+ strokeWidth: 4,
2683
+ strokePosition: "outside",
2684
+ strokeOpacity: 100,
2685
+ shadowEnabled: true,
2686
+ shadowColor: "rgba(255, 87, 34, 0.4)",
2687
+ shadowBlur: 8,
2688
+ shadowOffsetX: 0,
2689
+ shadowOffsetY: 2,
2690
+ shadowOpacity: 75
2691
+ }
2692
+ },
2693
+ {
2694
+ id: "frosted-glass",
2695
+ name: "Frosted Glass",
2696
+ category: "caption",
2697
+ config: {
2698
+ ...defaultConfig,
2699
+ text: "SAMPLE CAPTION",
2700
+ effectName: "Frosted Glass",
2701
+ fontFamily: "Inter Variable",
2702
+ fontWeight: 600,
2703
+ fontSize: 56,
2704
+ fillColor: "#FFFFFF",
2705
+ panelEnabled: true,
2706
+ panelColor: "#FFFFFF",
2707
+ panelOpacity: 18,
2708
+ panelRadius: 20,
2709
+ panelPaddingX: 32,
2710
+ panelPaddingY: 12,
2711
+ panelStrokeEnabled: true,
2712
+ panelStrokeColor: "rgba(255, 255, 255, 0.3)",
2713
+ panelStrokeWidth: 1.5,
2714
+ shadowEnabled: true,
2715
+ shadowColor: "rgba(0, 0, 0, 0.3)",
2716
+ shadowBlur: 8,
2717
+ shadowOffsetX: 0,
2718
+ shadowOffsetY: 4,
2719
+ shadowOpacity: 50
2720
+ }
2721
+ },
2722
+ {
2723
+ id: "typewriter-mono",
2724
+ name: "Typewriter Mono",
2725
+ category: "caption",
2726
+ config: {
2727
+ ...defaultConfig,
2728
+ text: "SAMPLE CAPTION",
2729
+ effectName: "Typewriter Mono",
2730
+ fontFamily: "Fira Code",
2731
+ fontWeight: 600,
2732
+ fontSize: 52,
2733
+ fillColor: "#FFFFFF",
2734
+ panelEnabled: true,
2735
+ panelColor: "#161622",
2736
+ panelOpacity: 90,
2737
+ panelRadius: 8,
2738
+ panelPaddingX: 24,
2739
+ panelPaddingY: 10,
2740
+ panelStrokeEnabled: true,
2741
+ panelStrokeColor: "#FFB800",
2742
+ panelStrokeWidth: 2
2743
+ }
2744
+ }
2745
+ ];
2551
2746
 
2552
2747
  // src/engine/timelineDefaults.ts
2553
2748
  function ensureDefaultTimeline(doc) {
@@ -8039,714 +8234,23 @@ function getRenderCapabilities(plan, target) {
8039
8234
  return plan.capabilities[target];
8040
8235
  }
8041
8236
 
8042
- // src/videoEffects/renderers/light/index.ts
8043
- var light_exports = {};
8044
- __export(light_exports, {
8045
- renderDustParticles: () => renderDustParticles,
8046
- renderFire: () => renderFire,
8047
- renderFlash: () => renderFlash,
8048
- renderFlicker: () => renderFlicker,
8049
- renderGlow: () => renderGlow,
8050
- renderLightLeak: () => renderLightLeak,
8051
- renderLightLeak2: () => renderLightLeak2,
8052
- renderParticles: () => renderParticles,
8053
- renderVignette: () => renderVignette
8054
- });
8055
-
8056
- // src/videoEffects/renderers/light/lightLeak.ts
8057
- function renderLightLeak(ctx, params, intensity, time) {
8058
- const width = ctx.canvas.width;
8059
- const height = ctx.canvas.height;
8060
- const gradient = ctx.createLinearGradient(0, 0, width, height);
8061
- gradient.addColorStop(0, `rgba(255, 200, 100, ${intensity * 0.3})`);
8062
- gradient.addColorStop(1, "rgba(255, 200, 100, 0)");
8063
- ctx.globalCompositeOperation = "screen";
8064
- ctx.fillStyle = gradient;
8065
- ctx.fillRect(0, 0, width, height);
8066
- ctx.globalCompositeOperation = "source-over";
8067
- }
8068
-
8069
- // src/videoEffects/utils/colorUtils.ts
8070
- function hexToRgba(hex, alpha2) {
8071
- hex = hex.replace("#", "");
8072
- const r = parseInt(hex.substring(0, 2), 16);
8073
- const g = parseInt(hex.substring(2, 4), 16);
8074
- const b = parseInt(hex.substring(4, 6), 16);
8075
- return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
8076
- }
8077
- function rgbaToComponents(rgba) {
8078
- const match = rgba.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
8079
- if (!match) {
8080
- return { r: 0, g: 0, b: 0, a: 1 };
8081
- }
8082
- return {
8083
- r: parseInt(match[1]),
8084
- g: parseInt(match[2]),
8085
- b: parseInt(match[3]),
8086
- a: match[4] ? parseFloat(match[4]) : 1
8087
- };
8088
- }
8089
- function blendColors(color1, color2, ratio) {
8090
- const c1 = rgbaToComponents(color1);
8091
- const c2 = rgbaToComponents(color2);
8092
- const r = Math.round(c1.r * (1 - ratio) + c2.r * ratio);
8093
- const g = Math.round(c1.g * (1 - ratio) + c2.g * ratio);
8094
- const b = Math.round(c1.b * (1 - ratio) + c2.b * ratio);
8095
- const a = c1.a * (1 - ratio) + c2.a * ratio;
8096
- return `rgba(${r}, ${g}, ${b}, ${a})`;
8097
- }
8098
-
8099
- // src/videoEffects/renderers/light/lightLeak2.ts
8100
- function renderLightLeak2(ctx, params, intensity, time) {
8101
- const width = ctx.canvas.width;
8102
- const height = ctx.canvas.height;
8103
- const duration = params.duration || 3;
8104
- const progress = time % duration / duration;
8105
- let x, y;
8106
- let fadeMultiplier = 1;
8107
- if (progress < 0.4) {
8108
- const phase1Progress = progress / 0.4;
8109
- x = width * phase1Progress;
8110
- y = height;
8111
- } else if (progress < 0.8) {
8112
- const phase2Progress = (progress - 0.4) / 0.4;
8113
- x = width;
8114
- y = height * (1 - phase2Progress);
8115
- } else {
8116
- const phase3Progress = (progress - 0.8) / 0.2;
8117
- x = width;
8118
- y = 0;
8119
- fadeMultiplier = 1 - phase3Progress;
8120
- }
8121
- const leakSize = Math.min(width, height) * (params.size || 0.8);
8122
- const gradient = ctx.createRadialGradient(x, y, 0, x, y, leakSize);
8123
- const color1 = params.color1 || "#FF6B35";
8124
- const color2 = params.color2 || "#FF8C42";
8125
- const color3 = params.color3 || "#FFA500";
8126
- const alpha2 = intensity * fadeMultiplier;
8127
- gradient.addColorStop(0, hexToRgba(color1, alpha2 * 0.9));
8128
- gradient.addColorStop(0.2, hexToRgba(color2, alpha2 * 0.7));
8129
- gradient.addColorStop(0.5, hexToRgba(color3, alpha2 * 0.4));
8130
- gradient.addColorStop(0.8, hexToRgba(color3, alpha2 * 0.1));
8131
- gradient.addColorStop(1, "rgba(255, 165, 0, 0)");
8132
- ctx.globalCompositeOperation = "screen";
8133
- ctx.fillStyle = gradient;
8134
- ctx.fillRect(0, 0, width, height);
8135
- ctx.globalCompositeOperation = "source-over";
8136
- }
8137
-
8138
- // src/videoEffects/renderers/light/flash.ts
8139
- function renderFlash(ctx, params, intensity, time) {
8140
- const flashColor = params.flashColor || "#ffffff";
8141
- const flashIntensity = (params.flashIntensity || 1) * intensity;
8142
- ctx.globalCompositeOperation = "screen";
8143
- ctx.fillStyle = flashColor;
8144
- ctx.globalAlpha = flashIntensity;
8145
- ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
8146
- ctx.globalAlpha = 1;
8147
- ctx.globalCompositeOperation = "source-over";
8148
- }
8149
-
8150
- // src/videoEffects/renderers/light/flicker.ts
8151
- function renderFlicker(ctx, params, intensity, time) {
8152
- const flickerAmount = Math.random() * intensity;
8153
- ctx.globalAlpha = 1 - flickerAmount * 0.5;
8154
- }
8155
-
8156
- // src/videoEffects/renderers/light/vignette.ts
8157
- function renderVignette(ctx, params, intensity, time) {
8158
- const width = ctx.canvas.width;
8159
- const height = ctx.canvas.height;
8160
- const radius = params.radius || 0.7;
8161
- const gradient = ctx.createRadialGradient(width / 2, height / 2, Math.min(width, height) * radius, width / 2, height / 2, Math.max(width, height));
8162
- gradient.addColorStop(0, "rgba(0, 0, 0, 0)");
8163
- gradient.addColorStop(1, `rgba(0, 0, 0, ${intensity * 0.7})`);
8164
- ctx.fillStyle = gradient;
8165
- ctx.fillRect(0, 0, width, height);
8166
- }
8167
-
8168
- // src/videoEffects/renderers/light/glow.ts
8169
- function renderGlow(ctx, params, intensity, time) {
8170
- const glowAmount = (params.glowAmount || 10) * intensity;
8171
- ctx.shadowBlur = glowAmount;
8172
- ctx.shadowColor = params.glowColor || "#ffffff";
8173
- }
8174
-
8175
- // src/videoEffects/renderers/light/fire.ts
8176
- function renderFire(ctx, params, intensity, time) {
8177
- const width = ctx.canvas.width;
8178
- const height = ctx.canvas.height;
8179
- const fireHeight = (params.fireHeight ?? 0.4) * height;
8180
- const particleCount = Math.floor((params.particleCount ?? 50) * intensity);
8181
- const fireColor1 = params.fireColor1 ?? "#FF4500";
8182
- const fireColor2 = params.fireColor2 ?? "#FFA500";
8183
- const fireColor3 = params.fireColor3 ?? "#FFD700";
8184
- const gradient = ctx.createLinearGradient(0, height, 0, height - fireHeight);
8185
- gradient.addColorStop(0, fireColor1);
8186
- gradient.addColorStop(0.5, fireColor2);
8187
- gradient.addColorStop(1, fireColor3);
8188
- ctx.globalAlpha = 0.6 * intensity;
8189
- ctx.fillStyle = gradient;
8190
- ctx.beginPath();
8191
- ctx.moveTo(0, height);
8192
- const waveCount = 8;
8193
- const waveAmplitude = 40;
8194
- const waveSpeed = time * 3;
8195
- for (let i = 0; i <= width; i += width / 100) {
8196
- const waveOffset = Math.sin(i / width * waveCount + waveSpeed) * waveAmplitude;
8197
- ctx.lineTo(i, height - fireHeight + waveOffset);
8198
- }
8199
- ctx.lineTo(width, height);
8200
- ctx.closePath();
8201
- ctx.fill();
8202
- ctx.globalAlpha = 0.8 * intensity;
8203
- for (let i = 0; i < particleCount; i++) {
8204
- const x = (Math.sin(time * 2 + i * 0.5) * 0.5 + 0.5) * width;
8205
- const particleProgress = (time * 0.5 + i * 0.1) % 1;
8206
- const y = height - particleProgress * fireHeight * 1.2;
8207
- const size = (1 - particleProgress) * 8 * intensity;
8208
- const alpha2 = (1 - particleProgress) * intensity;
8209
- ctx.globalAlpha = alpha2;
8210
- ctx.fillStyle = i % 3 === 0 ? fireColor1 : i % 3 === 1 ? fireColor2 : fireColor3;
8211
- ctx.beginPath();
8212
- ctx.arc(x, y, size, 0, Math.PI * 2);
8213
- ctx.fill();
8214
- }
8215
- ctx.globalAlpha = 1;
8216
- }
8217
-
8218
- // src/videoEffects/renderers/light/particles.ts
8219
- function renderParticles(ctx, params, intensity, time) {
8220
- const width = ctx.canvas.width;
8221
- const height = ctx.canvas.height;
8222
- const particleCount = Math.floor((params.particleCount ?? 100) * intensity);
8223
- const particleSize = (params.particleSize ?? 3) * intensity;
8224
- const particleColor = params.particleColor ?? "#FFFFFF";
8225
- const driftSpeed = params.driftSpeed ?? 1;
8226
- const fadeEffect = params.fadeEffect ?? true;
8227
- ctx.globalCompositeOperation = "screen";
8228
- for (let i = 0; i < particleCount; i++) {
8229
- const seed = i * 0.1;
8230
- const x = (Math.sin(time * driftSpeed * 0.5 + seed) * 0.5 + 0.5) * width;
8231
- const y = (time * driftSpeed * 20 + i * 15) % (height + 100) - 50;
8232
- const sizeVariation = Math.sin(time * 2 + seed) * 0.3 + 0.7;
8233
- const size = particleSize * sizeVariation;
8234
- let alpha2 = intensity * 0.8;
8235
- if (fadeEffect) {
8236
- if (y < 100) {
8237
- alpha2 *= y / 100;
8238
- } else if (y > height - 100) {
8239
- alpha2 *= (height - y) / 100;
8240
- }
8241
- }
8242
- ctx.globalAlpha = Math.max(0, alpha2);
8243
- ctx.fillStyle = particleColor;
8244
- ctx.beginPath();
8245
- ctx.arc(x, y, size, 0, Math.PI * 2);
8246
- ctx.fill();
8247
- }
8248
- ctx.globalAlpha = 1;
8249
- ctx.globalCompositeOperation = "source-over";
8250
- }
8251
- function renderDustParticles(ctx, params, intensity, time) {
8252
- const width = ctx.canvas.width;
8253
- const height = ctx.canvas.height;
8254
- const particleCount = Math.floor((params.particleCount ?? 60) * intensity);
8255
- const particleSize = (params.particleSize ?? 2) * intensity;
8256
- const particleColor = params.particleColor ?? "#E0E0E0";
8257
- ctx.globalCompositeOperation = "screen";
8258
- ctx.globalAlpha = 0.3 * intensity;
8259
- for (let i = 0; i < particleCount; i++) {
8260
- const seed = i * 0.05;
8261
- const x = (Math.sin(time * 0.2 + seed) * 0.5 + 0.5) * width;
8262
- const y = (Math.cos(time * 0.15 + seed * 2) * 0.5 + 0.5) * height;
8263
- const sizePulse = Math.sin(time + seed * 3) * 0.2 + 0.8;
8264
- const size = particleSize * sizePulse;
8265
- const alphaVariation = Math.sin(time * 0.5 + seed * 5) * 0.3 + 0.7;
8266
- ctx.globalAlpha = 0.2 * intensity * alphaVariation;
8267
- ctx.fillStyle = particleColor;
8268
- ctx.beginPath();
8269
- ctx.arc(x, y, size, 0, Math.PI * 2);
8270
- ctx.fill();
8271
- }
8272
- ctx.globalAlpha = 1;
8273
- ctx.globalCompositeOperation = "source-over";
8274
- }
8275
-
8276
8237
  // src/videoEffects/effectsRegistry.ts
8277
8238
  var EFFECTS_REGISTRY = {
8278
- // ==================== LIGHT EFFECTS ====================
8279
- light_leak: {
8280
- id: "light_leak",
8281
- name: "Light Leak",
8282
- category: "light",
8283
- description: "Classic light leak effect",
8284
- defaultParams: {},
8285
- parameterSchema: {},
8286
- tags: ["light", "vintage", "film"]
8287
- },
8288
- light_leak_2: {
8289
- id: "light_leak_2",
8290
- name: "Leak 2",
8291
- category: "light",
8292
- description: "Animated red/orange light moving across the frame",
8293
- defaultParams: {
8294
- duration: 3,
8295
- size: 0.8,
8296
- color1: "#FF6B35",
8297
- color2: "#FF8C42",
8298
- color3: "#FFA500"
8299
- },
8300
- parameterSchema: {
8301
- duration: {
8302
- type: "number",
8303
- label: "Duration",
8304
- min: 1,
8305
- max: 10,
8306
- default: 3,
8307
- step: 0.5
8308
- },
8309
- size: {
8310
- type: "number",
8311
- label: "Size",
8312
- min: 0.1,
8313
- max: 1.5,
8314
- default: 0.8,
8315
- step: 0.1
8316
- },
8317
- color1: {
8318
- type: "color",
8319
- label: "Primary Color",
8320
- default: "#FF6B35"
8321
- },
8322
- color2: {
8323
- type: "color",
8324
- label: "Secondary Color",
8325
- default: "#FF8C42"
8326
- },
8327
- color3: {
8328
- type: "color",
8329
- label: "Tertiary Color",
8330
- default: "#FFA500"
8331
- }
8332
- },
8333
- tags: ["light", "animated", "cinematic", "warm"]
8334
- },
8335
- flash: {
8336
- id: "flash",
8337
- name: "Flash",
8338
- category: "light",
8339
- description: "Bright flash effect",
8340
- defaultParams: { flashColor: "#ffffff", flashIntensity: 1 },
8341
- parameterSchema: {
8342
- flashColor: {
8343
- type: "color",
8344
- label: "Flash Color",
8345
- default: "#ffffff"
8346
- },
8347
- flashIntensity: {
8348
- type: "number",
8349
- label: "Intensity",
8350
- min: 0,
8351
- max: 1,
8352
- default: 1,
8353
- step: 0.1
8354
- }
8355
- },
8356
- tags: ["light", "bright", "instant"]
8357
- },
8358
- flicker: {
8359
- id: "flicker",
8360
- name: "Flicker",
8361
- category: "light",
8362
- description: "Random light flickering effect",
8363
- defaultParams: {},
8364
- parameterSchema: {},
8365
- tags: ["light", "flicker", "dynamic"]
8366
- },
8367
- vignette: {
8368
- id: "vignette",
8369
- name: "Vignette",
8370
- category: "light",
8371
- description: "Darkens the edges of the frame",
8372
- defaultParams: { radius: 0.7 },
8373
- parameterSchema: {
8374
- radius: {
8375
- type: "number",
8376
- label: "Radius",
8377
- min: 0.1,
8378
- max: 1,
8379
- default: 0.7,
8380
- step: 0.05
8381
- }
8382
- },
8383
- tags: ["light", "vintage", "cinematic"]
8384
- },
8385
- glow: {
8386
- id: "glow",
8387
- name: "Glow",
8388
- category: "light",
8389
- description: "Adds a glow effect",
8390
- defaultParams: { glowAmount: 10, glowColor: "#ffffff" },
8391
- parameterSchema: {
8392
- glowAmount: {
8393
- type: "number",
8394
- label: "Amount",
8395
- min: 0,
8396
- max: 50,
8397
- default: 10,
8398
- step: 1
8399
- },
8400
- glowColor: {
8401
- type: "color",
8402
- label: "Color",
8403
- default: "#ffffff"
8404
- }
8405
- },
8406
- tags: ["light", "soft", "dreamy"]
8407
- },
8408
- fire: {
8409
- id: "fire",
8410
- name: "Fire",
8411
- category: "light",
8412
- description: "Animated fire effect with particles",
8413
- defaultParams: {
8414
- fireHeight: 0.4,
8415
- particleCount: 50,
8416
- fireColor1: "#FF4500",
8417
- fireColor2: "#FFA500",
8418
- fireColor3: "#FFD700"
8419
- },
8420
- parameterSchema: {
8421
- fireHeight: {
8422
- type: "number",
8423
- label: "Fire Height",
8424
- min: 0.1,
8425
- max: 0.8,
8426
- default: 0.4,
8427
- step: 0.05
8428
- },
8429
- particleCount: {
8430
- type: "number",
8431
- label: "Particle Count",
8432
- min: 10,
8433
- max: 100,
8434
- default: 50,
8435
- step: 5
8436
- },
8437
- fireColor1: {
8438
- type: "color",
8439
- label: "Base Color",
8440
- default: "#FF4500"
8441
- },
8442
- fireColor2: {
8443
- type: "color",
8444
- label: "Mid Color",
8445
- default: "#FFA500"
8446
- },
8447
- fireColor3: {
8448
- type: "color",
8449
- label: "Top Color",
8450
- default: "#FFD700"
8451
- }
8452
- },
8453
- tags: ["light", "animated", "fire", "particles"]
8454
- },
8455
- particles: {
8456
- id: "particles",
8457
- name: "Particles",
8458
- category: "light",
8459
- description: "Floating particle effect",
8460
- defaultParams: {
8461
- particleCount: 100,
8462
- particleSize: 3,
8463
- particleColor: "#FFFFFF",
8464
- driftSpeed: 1,
8465
- fadeEffect: true
8466
- },
8467
- parameterSchema: {
8468
- particleCount: {
8469
- type: "number",
8470
- label: "Particle Count",
8471
- min: 20,
8472
- max: 200,
8473
- default: 100,
8474
- step: 10
8475
- },
8476
- particleSize: {
8477
- type: "number",
8478
- label: "Particle Size",
8479
- min: 1,
8480
- max: 10,
8481
- default: 3,
8482
- step: 0.5
8483
- },
8484
- particleColor: {
8485
- type: "color",
8486
- label: "Color",
8487
- default: "#FFFFFF"
8488
- },
8489
- driftSpeed: {
8490
- type: "number",
8491
- label: "Drift Speed",
8492
- min: 0.1,
8493
- max: 3,
8494
- default: 1,
8495
- step: 0.1
8496
- },
8497
- fadeEffect: {
8498
- type: "boolean",
8499
- label: "Fade at Edges",
8500
- default: true
8501
- }
8502
- },
8503
- tags: ["light", "animated", "particles", "floating"]
8504
- },
8505
- dust_particles: {
8506
- id: "dust_particles",
8507
- name: "Dust Particles",
8508
- category: "light",
8509
- description: "Slow drifting dust particles",
8510
- defaultParams: {
8511
- particleCount: 60,
8512
- particleSize: 2,
8513
- particleColor: "#E0E0E0"
8514
- },
8515
- parameterSchema: {
8516
- particleCount: {
8517
- type: "number",
8518
- label: "Particle Count",
8519
- min: 20,
8520
- max: 150,
8521
- default: 60,
8522
- step: 10
8523
- },
8524
- particleSize: {
8525
- type: "number",
8526
- label: "Particle Size",
8527
- min: 1,
8528
- max: 5,
8529
- default: 2,
8530
- step: 0.5
8531
- },
8532
- particleColor: {
8533
- type: "color",
8534
- label: "Color",
8535
- default: "#E0E0E0"
8536
- }
8537
- },
8538
- tags: ["light", "particles", "dust", "subtle"]
8539
- },
8540
- // ==================== BODY EFFECTS ====================
8541
- body_glow: {
8542
- id: "body_glow",
8543
- name: "Body Glow",
8544
- category: "body",
8545
- description: "Adds a soft neon glow around the body silhouette",
8546
- defaultParams: { glowColor: "#7C6FFF", glowRadius: 20, glowIntensity: 0.8 },
8547
- parameterSchema: {
8548
- glowColor: { type: "color", label: "Glow Color", default: "#7C6FFF" },
8549
- glowRadius: { type: "number", label: "Glow Radius", min: 5, max: 50, default: 20, step: 1 },
8550
- glowIntensity: { type: "number", label: "Glow Intensity", min: 0.1, max: 1, default: 0.8, step: 0.05 }
8551
- },
8552
- tags: ["body", "neon", "glow"]
8553
- },
8554
- body_outline: {
8555
- id: "body_outline",
8556
- name: "Body Outline",
8557
- category: "body",
8558
- description: "Traces the outline of the body with a glowing line",
8559
- defaultParams: { outlineColor: "#00E5FF", outlineWidth: 6, feather: 15 },
8560
- parameterSchema: {
8561
- outlineColor: { type: "color", label: "Outline Color", default: "#00E5FF" },
8562
- outlineWidth: { type: "number", label: "Outline Width", min: 2, max: 20, default: 6, step: 1 },
8563
- feather: { type: "number", label: "Feather", min: 0, max: 30, default: 15, step: 1 }
8564
- },
8565
- tags: ["body", "outline", "glowing"]
8566
- },
8567
- body_particles: {
8568
- id: "body_particles",
8569
- name: "Body Particles",
8570
- category: "body",
8571
- description: "Emits floating particles tracing the body shape",
8572
- defaultParams: { particleColor: "#FF2A85", particleCount: 60, particleSize: 3, drift: 8 },
8573
- parameterSchema: {
8574
- particleColor: { type: "color", label: "Particle Color", default: "#FF2A85" },
8575
- particleCount: { type: "number", label: "Particle Count", min: 10, max: 150, default: 60, step: 5 },
8576
- particleSize: { type: "number", label: "Particle Size", min: 1, max: 8, default: 3, step: 0.5 },
8577
- drift: { type: "number", label: "Drift", min: 2, max: 20, default: 8, step: 1 }
8578
- },
8579
- tags: ["body", "particles", "floating"]
8580
- },
8581
- "body-segmentation-glow": {
8582
- id: "body-segmentation-glow",
8583
- name: "Segmentation Glow",
8584
- category: "body",
8585
- description: "Glow overlay matching body segmentation mask",
8586
- defaultParams: { glowColor: "#FFD700", glowRadius: 25 },
8587
- parameterSchema: {
8588
- glowColor: { type: "color", label: "Color", default: "#FFD700" },
8589
- glowRadius: { type: "number", label: "Radius", min: 5, max: 50, default: 25, step: 1 }
8590
- },
8591
- tags: ["body", "segmentation", "glow"]
8592
- },
8593
- // Native video filter effects (unified registry metadata)
8594
- "light-leak": {
8595
- id: "light-leak",
8596
- name: "Light Leak",
8597
- category: "light",
8598
- description: "Classic cinematic light sweep across the frame",
8599
- defaultParams: { gain: 0.6, lacunarity: 2.5, alpha: 0.8, angle: 30, speed: 1, animated: true },
8600
- parameterSchema: {
8601
- gain: { type: "number", label: "Gain", min: 0, max: 1, default: 0.6, step: 0.05 },
8602
- lacunarity: { type: "number", label: "Lacunarity", min: 0, max: 5, default: 2.5, step: 0.1 },
8603
- alpha: { type: "number", label: "Alpha", min: 0, max: 1, default: 0.8, step: 0.05 },
8604
- angle: { type: "number", label: "Angle", min: -180, max: 180, default: 30, step: 5 },
8605
- speed: { type: "number", label: "Speed", min: 0, max: 5, default: 1, step: 0.1 }
8606
- },
8607
- tags: ["light", "vintage", "film"]
8608
- },
8609
- "lens-flare": {
8610
- id: "lens-flare",
8611
- name: "Lens Flare",
8612
- category: "light",
8613
- description: "Double-stage lens flare: Godray filter coupled with an animated GPU starburst shader.",
8614
- defaultParams: { godrayGain: 0.4, godrayAlpha: 0.5, flareIntensity: 0.8, flareColor: "#7C6FFF", speed: 1, animated: true },
8615
- parameterSchema: {
8616
- godrayGain: { type: "number", label: "Rays Gain", min: 0, max: 1, default: 0.4, step: 0.05 },
8617
- godrayAlpha: { type: "number", label: "Rays Alpha", min: 0, max: 1, default: 0.5, step: 0.05 },
8618
- flareIntensity: { type: "number", label: "Intensity", min: 0, max: 3, default: 0.8, step: 0.05 },
8619
- flareColor: { type: "color", label: "Color", default: "#7C6FFF" },
8620
- speed: { type: "number", label: "Speed", min: 0, max: 4, default: 1, step: 0.1 }
8621
- },
8622
- tags: ["light", "flare", "cinematic"]
8623
- },
8624
- "rgb-split": {
8625
- id: "rgb-split",
8626
- name: "RGB Split",
8627
- category: "glitch",
8628
- description: "Split red, green, and blue channels",
8629
- defaultParams: { redX: 4, redY: 0, blueX: -4, blueY: 0, greenX: 0, greenY: 0, speed: 1.5, animated: true },
8630
- parameterSchema: {
8631
- redX: { type: "number", label: "Red X", min: -50, max: 50, default: 4, step: 0.5 },
8632
- redY: { type: "number", label: "Red Y", min: -50, max: 50, default: 0, step: 0.5 },
8633
- blueX: { type: "number", label: "Blue X", min: -50, max: 50, default: -4, step: 0.5 },
8634
- blueY: { type: "number", label: "Blue Y", min: -50, max: 50, default: 0, step: 0.5 },
8635
- greenX: { type: "number", label: "Green X", min: -50, max: 50, default: 0, step: 0.5 },
8636
- greenY: { type: "number", label: "Green Y", min: -50, max: 50, default: 0, step: 0.5 },
8637
- speed: { type: "number", label: "Speed", min: 0.1, max: 5, default: 1.5, step: 0.1 }
8638
- },
8639
- tags: ["glitch", "rgb", "chromatic"]
8640
- },
8641
- "vhs": {
8642
- id: "vhs",
8643
- name: "VHS",
8644
- category: "glitch",
8645
- description: "Vintage tape tracking lines and phosphor noise",
8646
- defaultParams: { noise: 0.08, scanlines: true, lineAlpha: 0.25, hShift: 3e-3, bandSpeed: 1.2, bandAlpha: 0.35 },
8647
- parameterSchema: {
8648
- noise: { type: "number", label: "Noise", min: 0, max: 0.3, default: 0.08, step: 0.01 },
8649
- scanlines: { type: "boolean", label: "Scanlines", default: true },
8650
- lineAlpha: { type: "number", label: "Line Alpha", min: 0, max: 1, default: 0.25, step: 0.05 },
8651
- hShift: { type: "number", label: "H-Shift", min: 0, max: 0.02, default: 3e-3, step: 1e-3 },
8652
- bandSpeed: { type: "number", label: "Band Speed", min: 0.1, max: 5, default: 1.2, step: 0.1 },
8653
- bandAlpha: { type: "number", label: "Band Alpha", min: 0, max: 1, default: 0.35, step: 0.05 }
8654
- },
8655
- tags: ["glitch", "retro", "vhs", "tape"]
8656
- },
8657
- "glitch-band": {
8658
- id: "glitch-band",
8659
- name: "Glitch Band",
8660
- category: "glitch",
8661
- description: "Digital glitch slices running dynamically",
8662
- defaultParams: { slices: 15, offset: 80, direction: 0, redX: -3, redY: 0, blueX: 3, blueY: 0, animated: true },
8663
- parameterSchema: {
8664
- slices: { type: "number", label: "Slices", min: 2, max: 80, default: 15, step: 1 },
8665
- offset: { type: "number", label: "Offset", min: 0, max: 400, default: 80, step: 5 },
8666
- direction: { type: "number", label: "Direction", min: 0, max: 360, default: 0, step: 5 },
8667
- redX: { type: "number", label: "Red X", min: -20, max: 20, default: -3, step: 1 },
8668
- redY: { type: "number", label: "Red Y", min: -20, max: 20, default: 0, step: 1 },
8669
- blueX: { type: "number", label: "Blue X", min: -20, max: 20, default: 3, step: 1 },
8670
- blueY: { type: "number", label: "Blue Y", min: -20, max: 20, default: 0, step: 1 }
8671
- },
8672
- tags: ["glitch", "digital", "distortion"]
8673
- },
8674
- "crt": {
8675
- id: "crt",
8676
- name: "CRT Monitor",
8677
- category: "glitch",
8678
- description: "Old television curve display and phosphor noise",
8679
- defaultParams: { curvature: 1, lineWidth: 1, lineContrast: 0.25, noise: 0.15, vignetting: 0.3, flicker: 0.15, animated: true },
8680
- parameterSchema: {
8681
- curvature: { type: "number", label: "Curvature", min: 0, max: 6, default: 1, step: 0.1 },
8682
- lineWidth: { type: "number", label: "Line Width", min: 0, max: 5, default: 1, step: 0.5 },
8683
- lineContrast: { type: "number", label: "Line Contrast", min: 0, max: 1, default: 0.25, step: 0.05 },
8684
- noise: { type: "number", label: "Noise", min: 0, max: 0.8, default: 0.15, step: 0.05 },
8685
- vignetting: { type: "number", label: "Vignette Size", min: 0, max: 0.8, default: 0.3, step: 0.05 },
8686
- flicker: { type: "number", label: "Flicker", min: 0, max: 0.5, default: 0.15, step: 0.05 }
8687
- },
8688
- tags: ["glitch", "retro", "tv"]
8689
- },
8690
- "film-grain": {
8691
- id: "film-grain",
8692
- name: "Film Grain",
8693
- category: "cinematic",
8694
- description: "Real organic analog movie grain",
8695
- defaultParams: { intensity: 0.25, size: 2, animated: true },
8696
- parameterSchema: {
8697
- intensity: { type: "number", label: "Intensity", min: 0, max: 1, default: 0.25, step: 0.05 },
8698
- size: { type: "number", label: "Grain Size", min: 0.5, max: 6, default: 2, step: 0.1 }
8699
- },
8700
- tags: ["cinematic", "film", "grain"]
8701
- },
8702
- "tilt-shift": {
8703
- id: "tilt-shift",
8704
- name: "Tilt Shift",
8705
- category: "cinematic",
8706
- description: "Miniature belt blur focus effect",
8707
- defaultParams: { blur: 40, gradientBlur: 300, focusY: 0.5, focusRange: 0.15 },
8708
- parameterSchema: {
8709
- blur: { type: "number", label: "Edge Blur", min: 0, max: 100, default: 40, step: 1 },
8710
- gradientBlur: { type: "number", label: "Gradient Blur", min: 50, max: 800, default: 300, step: 10 },
8711
- focusY: { type: "number", label: "Focus Position", min: 0, max: 1, default: 0.5, step: 0.05 },
8712
- focusRange: { type: "number", label: "Focus Range", min: 0.05, max: 0.4, default: 0.15, step: 0.05 }
8713
- },
8714
- tags: ["cinematic", "blur", "miniature"]
8715
- },
8716
- "cinematic-lut": {
8717
- id: "cinematic-lut",
8718
- name: "Cinematic LUT",
8719
- category: "cinematic",
8720
- description: "Orange and Teal cinematic lookup table filter",
8721
- defaultParams: { lutIntensity: 0.8, brightness: 1, contrast: 1, saturation: 1 },
8722
- parameterSchema: {
8723
- lutIntensity: { type: "number", label: "LUT Intensity", min: 0, max: 1, default: 0.8, step: 0.05 },
8724
- brightness: { type: "number", label: "Brightness", min: 0.5, max: 1.5, default: 1, step: 0.05 },
8725
- contrast: { type: "number", label: "Contrast", min: 0.5, max: 1.5, default: 1, step: 0.05 },
8726
- saturation: { type: "number", label: "Saturation", min: 0, max: 2, default: 1, step: 0.05 }
8727
- },
8728
- tags: ["cinematic", "color", "lut"]
8729
- },
8730
- "motion-blur": {
8731
- id: "motion-blur",
8732
- name: "Motion Blur",
8733
- category: "cinematic",
8734
- description: "Speed-based directional camera blur",
8735
- defaultParams: { velocityX: 20, velocityY: 0, kernelSize: 9, offset: 0 },
8736
- parameterSchema: {
8737
- velocityX: { type: "number", label: "Velocity X", min: -80, max: 80, default: 20, step: 1 },
8738
- velocityY: { type: "number", label: "Velocity Y", min: -80, max: 80, default: 0, step: 1 },
8739
- kernelSize: { type: "number", label: "Kernel Size", min: 5, max: 25, default: 9, step: 2 },
8740
- offset: { type: "number", label: "Offset", min: 0, max: 10, default: 0, step: 1 }
8741
- },
8742
- tags: ["cinematic", "blur", "motion"]
8743
- },
8744
- "shockwave": {
8239
+ shockwave: {
8745
8240
  id: "shockwave",
8746
8241
  name: "Shockwave",
8747
8242
  category: "distortion",
8748
8243
  description: "Expanding shockwave wave refraction",
8749
- defaultParams: { centerX: 0.5, centerY: 0.5, speed: 1.5, amplitude: 30, wavelength: 160, brightness: 1, radius: 600, animated: true },
8244
+ defaultParams: {
8245
+ centerX: 0.5,
8246
+ centerY: 0.5,
8247
+ speed: 1.5,
8248
+ amplitude: 30,
8249
+ wavelength: 160,
8250
+ brightness: 1,
8251
+ radius: 600,
8252
+ animated: true
8253
+ },
8750
8254
  parameterSchema: {
8751
8255
  centerX: { type: "number", label: "Center X", min: 0, max: 1, default: 0.5, step: 0.05 },
8752
8256
  centerY: { type: "number", label: "Center Y", min: 0, max: 1, default: 0.5, step: 0.05 },
@@ -8758,526 +8262,86 @@ var EFFECTS_REGISTRY = {
8758
8262
  },
8759
8263
  tags: ["distortion", "ripple", "shockwave"]
8760
8264
  },
8761
- "bulge-pinch": {
8762
- id: "bulge-pinch",
8763
- name: "Bulge Pinch",
8764
- category: "distortion",
8765
- description: "Spherical bulge or pinch warp",
8766
- defaultParams: { centerX: 0.5, centerY: 0.5, radius: 200, strength: 0.5, speed: 1.5, animated: true },
8767
- parameterSchema: {
8768
- centerX: { type: "number", label: "Center X", min: 0, max: 1, default: 0.5, step: 0.05 },
8769
- centerY: { type: "number", label: "Center Y", min: 0, max: 1, default: 0.5, step: 0.05 },
8770
- radius: { type: "number", label: "Warp Radius", min: 10, max: 600, default: 200, step: 10 },
8771
- strength: { type: "number", label: "Warp Strength", min: -1, max: 1, default: 0.5, step: 0.05 },
8772
- speed: { type: "number", label: "Speed", min: 0.1, max: 5, default: 1.5, step: 0.1 }
8265
+ ChromaticAberration: {
8266
+ id: "ChromaticAberration",
8267
+ name: "Chromatic Aberration",
8268
+ category: "glitch",
8269
+ description: "Directional RGB channel displacement with optical edge-feather falloff",
8270
+ defaultParams: {
8271
+ amount: 8,
8272
+ angleDegrees: 0,
8273
+ edgeFeather: 0.5
8773
8274
  },
8774
- tags: ["distortion", "bulge", "pinch"]
8775
- },
8776
- "twist": {
8777
- id: "twist",
8778
- name: "Twist Twirl",
8779
- category: "distortion",
8780
- description: "Warp frame in a spiral twirl",
8781
- defaultParams: { centerX: 0.5, centerY: 0.5, radius: 300, angle: 4, speed: 1, animated: true },
8782
8275
  parameterSchema: {
8783
- centerX: { type: "number", label: "Center X", min: 0, max: 1, default: 0.5, step: 0.05 },
8784
- centerY: { type: "number", label: "Center Y", min: 0, max: 1, default: 0.5, step: 0.05 },
8785
- radius: { type: "number", label: "Twirl Radius", min: 50, max: 800, default: 300, step: 10 },
8786
- angle: { type: "number", label: "Angle", min: -15, max: 15, default: 4, step: 0.5 },
8787
- speed: { type: "number", label: "Speed", min: 0.1, max: 5, default: 1, step: 0.1 }
8276
+ amount: { type: "number", label: "Amount (px)", min: 0, max: 50, default: 8, step: 0.5 },
8277
+ angleDegrees: { type: "number", label: "Angle (\xB0)", min: 0, max: 360, default: 0, step: 1 },
8278
+ edgeFeather: { type: "number", label: "Edge Feather", min: 0, max: 1, default: 0.5, step: 0.05 }
8788
8279
  },
8789
- tags: ["distortion", "twist", "twirl"]
8280
+ tags: ["glitch", "chromatic", "aberration", "color", "distortion", "lens", "optical"]
8790
8281
  },
8791
- "reflection": {
8792
- id: "reflection",
8793
- name: "Reflection",
8794
- category: "distortion",
8795
- description: "Water mirror ripple reflection",
8796
- defaultParams: { boundary: 0.5, amplitudeStart: 0, amplitudeEnd: 20, wavelengthStart: 30, wavelengthEnd: 100, alphaStart: 1, alphaEnd: 1, speed: 1, mirror: true, animated: true },
8797
- parameterSchema: {
8798
- boundary: { type: "number", label: "Boundary", min: 0.1, max: 0.9, default: 0.5, step: 0.05 },
8799
- amplitudeStart: { type: "number", label: "Amp Start", min: 0, max: 50, default: 0, step: 1 },
8800
- amplitudeEnd: { type: "number", label: "Amp End", min: 0, max: 100, default: 20, step: 1 },
8801
- wavelengthStart: { type: "number", label: "Wavelength Start", min: 10, max: 100, default: 30, step: 5 },
8802
- wavelengthEnd: { type: "number", label: "Wavelength End", min: 10, max: 300, default: 100, step: 5 },
8803
- alphaStart: { type: "number", label: "Alpha Start", min: 0, max: 1, default: 1, step: 0.05 },
8804
- alphaEnd: { type: "number", label: "Alpha End", min: 0, max: 1, default: 1, step: 0.05 },
8805
- speed: { type: "number", label: "Speed", min: 0.1, max: 5, default: 1, step: 0.1 }
8282
+ RgbSplit: {
8283
+ id: "RgbSplit",
8284
+ name: "RGB Split",
8285
+ category: "glitch",
8286
+ description: "Discrete horizontal and vertical color channel separation",
8287
+ defaultParams: {
8288
+ splitX: 8,
8289
+ splitY: 8
8806
8290
  },
8807
- tags: ["distortion", "reflection", "water"]
8808
- },
8809
- "color-gradient": {
8810
- id: "color-gradient",
8811
- name: "Color Gradient",
8812
- category: "light",
8813
- description: "Overlay a linear or radial multi-stop color gradient.",
8814
- defaultParams: { gradientType: 0, color1: "#7C6FFF", color2: "#0E0E12", alpha: 0.5 },
8815
8291
  parameterSchema: {
8816
- gradientType: { type: "number", label: "Type (0:Lin, 1:Rad)", min: 0, max: 1, default: 0, step: 1 },
8817
- color1: { type: "color", label: "Start Color", default: "#7C6FFF" },
8818
- color2: { type: "color", label: "End Color", default: "#0E0E12" },
8819
- alpha: { type: "number", label: "Alpha", min: 0, max: 1, default: 0.5, step: 0.05 }
8292
+ splitX: { type: "number", label: "Split X (px)", min: 0, max: 50, default: 8, step: 0.5 },
8293
+ splitY: { type: "number", label: "Split Y (px)", min: 0, max: 50, default: 8, step: 0.5 }
8820
8294
  },
8821
- tags: ["light", "color", "gradient"]
8295
+ tags: ["glitch", "rgb", "split", "color", "shift"]
8822
8296
  },
8823
- "color-overlay": {
8824
- id: "color-overlay",
8825
- name: "Color Overlay",
8826
- category: "light",
8827
- description: "Overlay a solid tint color onto the frame.",
8828
- defaultParams: { color: "#7C6FFF", alpha: 0.3 },
8297
+ FilmGrain: {
8298
+ id: "FilmGrain",
8299
+ name: "Film Grain",
8300
+ category: "retro",
8301
+ description: "Procedural cinematic film grain with adjustable size and intensity",
8302
+ defaultParams: {
8303
+ grainIntensity: 0.15,
8304
+ grainSize: 1,
8305
+ grainSeed: 0,
8306
+ animated: true
8307
+ },
8829
8308
  parameterSchema: {
8830
- color: { type: "color", label: "Color", default: "#7C6FFF" },
8831
- alpha: { type: "number", label: "Opacity", min: 0, max: 1, default: 0.3, step: 0.05 }
8309
+ grainIntensity: { type: "number", label: "Intensity", min: 0, max: 1, default: 0.15, step: 0.01 },
8310
+ grainSize: { type: "number", label: "Grain Size", min: 0.1, max: 5, default: 1, step: 0.1 },
8311
+ grainSeed: { type: "number", label: "Grain Seed", min: 0, max: 100, default: 0, step: 0.1 },
8312
+ animated: { type: "boolean", label: "Animated", default: true }
8832
8313
  },
8833
- tags: ["light", "color", "overlay"]
8314
+ tags: ["retro", "film", "grain", "noise", "cinematic", "texture"]
8834
8315
  },
8835
- "color-adjustments": {
8836
- id: "color-adjustments",
8837
- name: "Color Adjustments",
8838
- category: "light",
8839
- description: "Adjust exposure, brightness, contrast, saturation, temperature, tint, sepia, grayscale, hue, invert, and vignette.",
8316
+ Scanlines: {
8317
+ id: "Scanlines",
8318
+ name: "Scanlines",
8319
+ category: "retro",
8320
+ description: "CRT raster scanlines with controllable count and intensity",
8840
8321
  defaultParams: {
8841
- exposure: 0,
8842
- brightness: 0,
8843
- contrast: 0,
8844
- saturation: 0,
8845
- temperature: 0,
8846
- tint: 0,
8847
- sepia: 0,
8848
- grayscale: 0,
8849
- hueRotate: 0,
8850
- vignette: 0,
8851
- invert: 0,
8852
- blur: 0
8322
+ scanlineCount: 120,
8323
+ scanlineIntensity: 0.5
8853
8324
  },
8854
8325
  parameterSchema: {
8855
- exposure: { type: "number", label: "Exposure", min: -1, max: 1, default: 0, step: 0.01 },
8856
- brightness: { type: "number", label: "Brightness", min: -1, max: 1, default: 0, step: 0.01 },
8857
- contrast: { type: "number", label: "Contrast", min: -1, max: 1, default: 0, step: 0.01 },
8858
- saturation: { type: "number", label: "Saturation", min: -1, max: 1, default: 0, step: 0.01 },
8859
- temperature: { type: "number", label: "Temperature", min: -1, max: 1, default: 0, step: 0.01 },
8860
- tint: { type: "number", label: "Tint", min: -1, max: 1, default: 0, step: 0.01 },
8861
- sepia: { type: "number", label: "Sepia", min: 0, max: 1, default: 0, step: 0.01 },
8862
- grayscale: { type: "number", label: "Grayscale", min: 0, max: 1, default: 0, step: 0.01 },
8863
- hueRotate: { type: "number", label: "Hue Rotate", min: 0, max: 6.28318, default: 0, step: 0.01 },
8864
- vignette: { type: "number", label: "Vignette", min: 0, max: 1, default: 0, step: 0.01 },
8865
- invert: { type: "number", label: "Invert", min: 0, max: 1, default: 0, step: 0.01 },
8866
- blur: { type: "number", label: "Blur", min: 0, max: 15, default: 0, step: 0.5 }
8326
+ scanlineCount: { type: "number", label: "Line Count", min: 10, max: 1e3, default: 120, step: 10 },
8327
+ scanlineIntensity: { type: "number", label: "Intensity", min: 0, max: 1, default: 0.5, step: 0.05 }
8867
8328
  },
8868
- tags: ["color", "adjustments", "light", "vignette"]
8329
+ tags: ["retro", "crt", "scanlines", "tv", "vhs", "analog"]
8869
8330
  },
8870
- "hsl-adjustment": {
8871
- id: "hsl-adjustment",
8872
- name: "HSL Adjustment",
8873
- category: "light",
8874
- description: "Adjust hue, saturation, and lightness of the video.",
8875
- defaultParams: { hue: 0, saturation: 0, lightness: 0, colorize: false, alpha: 1 },
8876
- parameterSchema: {
8877
- hue: { type: "number", label: "Hue", min: -180, max: 180, default: 0, step: 1 },
8878
- saturation: { type: "number", label: "Saturation", min: -1, max: 1, default: 0, step: 0.05 },
8879
- lightness: { type: "number", label: "Lightness", min: -1, max: 1, default: 0, step: 0.05 },
8880
- colorize: { type: "boolean", label: "Colorize", default: false },
8881
- alpha: { type: "number", label: "Alpha", min: 0, max: 1, default: 1, step: 0.05 }
8331
+ Pixelate: {
8332
+ id: "Pixelate",
8333
+ name: "Pixelate",
8334
+ category: "retro",
8335
+ description: "Mosaic pixelation with adjustable block size",
8336
+ defaultParams: {
8337
+ pixelSize: 18
8882
8338
  },
8883
- tags: ["light", "color", "hsl", "hue"]
8884
- },
8885
- "alpha": {
8886
- id: "alpha",
8887
- name: "Opacity (Alpha)",
8888
- category: "light",
8889
- description: "Adjust layer opacity / alpha transparency.",
8890
- defaultParams: { alpha: 1 },
8891
8339
  parameterSchema: {
8892
- alpha: { type: "number", label: "Opacity", min: 0, max: 1, default: 1, step: 0.05 }
8340
+ pixelSize: { type: "number", label: "Block Size (px)", min: 1, max: 100, default: 18, step: 1 }
8893
8341
  },
8894
- tags: ["light", "alpha", "opacity"]
8895
- },
8896
- "color-matrix": {
8897
- id: "color-matrix",
8898
- name: "Color Matrix Presets",
8899
- category: "light",
8900
- description: "Color grading adjustments and retro filter presets.",
8901
- defaultParams: { brightness: 1, contrast: 1, saturation: 1, hue: 0, mode: "none" },
8902
- parameterSchema: {
8903
- brightness: { type: "number", label: "Brightness", min: 0, max: 2, default: 1, step: 0.05 },
8904
- contrast: { type: "number", label: "Contrast", min: 0, max: 2, default: 1, step: 0.05 },
8905
- saturation: { type: "number", label: "Saturation", min: 0, max: 2, default: 1, step: 0.05 },
8906
- hue: { type: "number", label: "Hue", min: -180, max: 180, default: 0, step: 2 },
8907
- mode: { type: "string", label: "Preset", default: "none" }
8908
- },
8909
- tags: ["light", "color", "presets", "vintage"]
8910
- },
8911
- "neon-glow": {
8912
- id: "neon-glow",
8913
- name: "Neon Glow (Community)",
8914
- category: "light",
8915
- description: "Wrap your visual features in a premium neon glow outline.",
8916
- defaultParams: { distance: 15, innerStrength: 1, outerStrength: 2, color: "#7C6FFF", quality: 0.1, knockout: false },
8917
- parameterSchema: {
8918
- distance: { type: "number", label: "Distance", min: 1, max: 100, default: 15, step: 1 },
8919
- innerStrength: { type: "number", label: "Inner Strength", min: 0, max: 10, default: 1, step: 0.2 },
8920
- outerStrength: { type: "number", label: "Outer Strength", min: 0, max: 10, default: 2, step: 0.2 },
8921
- color: { type: "color", label: "Glow Color", default: "#7C6FFF" },
8922
- quality: { type: "number", label: "Quality", min: 0.01, max: 1, default: 0.1, step: 0.05 },
8923
- knockout: { type: "boolean", label: "Knockout", default: false }
8924
- },
8925
- tags: ["light", "glow", "neon", "outline"]
8926
- },
8927
- "gaussian-blur": {
8928
- id: "gaussian-blur",
8929
- name: "Gaussian Blur",
8930
- category: "cinematic",
8931
- description: "Classic high-fidelity Gaussian blur filter.",
8932
- defaultParams: { blur: 8, quality: 4 },
8933
- parameterSchema: {
8934
- blur: { type: "number", label: "Blur Strength", min: 0, max: 100, default: 8, step: 0.5 },
8935
- quality: { type: "number", label: "Quality passes", min: 1, max: 15, default: 4, step: 1 }
8936
- },
8937
- tags: ["cinematic", "blur", "gaussian"]
8938
- },
8939
- "kawase-blur": {
8940
- id: "kawase-blur",
8941
- name: "Kawase Blur",
8942
- category: "cinematic",
8943
- description: "Fast, high-quality multi-pass Kawase blur.",
8944
- defaultParams: { blur: 8, quality: 4 },
8945
- parameterSchema: {
8946
- blur: { type: "number", label: "Blur Radius", min: 0, max: 100, default: 8, step: 0.5 },
8947
- quality: { type: "number", label: "Quality passes", min: 1, max: 15, default: 4, step: 1 }
8948
- },
8949
- tags: ["cinematic", "blur", "kawase"]
8950
- },
8951
- "zoom-blur": {
8952
- id: "zoom-blur",
8953
- name: "Zoom Blur",
8954
- category: "cinematic",
8955
- description: "Radial focal zoom blur emanating from a point.",
8956
- defaultParams: { strength: 0.15, centerX: 0.5, centerY: 0.5, innerRadius: 0, radius: 400 },
8957
- parameterSchema: {
8958
- strength: { type: "number", label: "Blur Strength", min: 0, max: 1, default: 0.15, step: 0.02 },
8959
- centerX: { type: "number", label: "Center X", min: 0, max: 1, default: 0.5, step: 0.05 },
8960
- centerY: { type: "number", label: "Center Y", min: 0, max: 1, default: 0.5, step: 0.05 },
8961
- innerRadius: { type: "number", label: "Inner Rad", min: 0, max: 600, default: 0, step: 10 },
8962
- radius: { type: "number", label: "Outer Rad", min: 50, max: 1200, default: 400, step: 10 }
8963
- },
8964
- tags: ["cinematic", "blur", "zoom", "focus"]
8965
- },
8966
- "radial-blur": {
8967
- id: "radial-blur",
8968
- name: "Radial Blur",
8969
- category: "cinematic",
8970
- description: "Radial spin blur around a focal center point.",
8971
- defaultParams: { angle: 10, centerX: 0.5, centerY: 0.5, kernelSize: 9, radius: -1 },
8972
- parameterSchema: {
8973
- angle: { type: "number", label: "Spin Angle", min: -180, max: 180, default: 10, step: 1 },
8974
- centerX: { type: "number", label: "Center X", min: 0, max: 1, default: 0.5, step: 0.05 },
8975
- centerY: { type: "number", label: "Center Y", min: 0, max: 1, default: 0.5, step: 0.05 },
8976
- kernelSize: { type: "number", label: "Kernel Size", min: 3, max: 25, default: 9, step: 2 },
8977
- radius: { type: "number", label: "Max Radius", min: -1, max: 1200, default: -1, step: 10 }
8978
- },
8979
- tags: ["cinematic", "blur", "radial", "spin"]
8980
- },
8981
- "drop-shadow": {
8982
- id: "drop-shadow",
8983
- name: "Drop Shadow",
8984
- category: "cinematic",
8985
- description: "Apply an adjustable drop shadow overlay onto your layer.",
8986
- defaultParams: { blur: 4, alpha: 0.5, offsetX: 4, offsetY: 4, color: "#000000", shadowOnly: false },
8987
- parameterSchema: {
8988
- blur: { type: "number", label: "Shadow Blur", min: 0, max: 50, default: 4, step: 0.5 },
8989
- alpha: { type: "number", label: "Shadow Alpha", min: 0, max: 1, default: 0.5, step: 0.05 },
8990
- offsetX: { type: "number", label: "Offset X", min: -100, max: 100, default: 4, step: 1 },
8991
- offsetY: { type: "number", label: "Offset Y", min: -100, max: 100, default: 4, step: 1 },
8992
- color: { type: "color", label: "Shadow Color", default: "#000000" },
8993
- shadowOnly: { type: "boolean", label: "Shadow Only", default: false }
8994
- },
8995
- tags: ["cinematic", "shadow", "drop"]
8996
- },
8997
- "static-noise": {
8998
- id: "static-noise",
8999
- name: "Static Noise",
9000
- category: "glitch",
9001
- description: "Classic static analog noise/grain filter.",
9002
- defaultParams: { noise: 0.15, animated: true },
9003
- parameterSchema: {
9004
- noise: { type: "number", label: "Noise Density", min: 0, max: 1, default: 0.15, step: 0.02 },
9005
- animated: { type: "boolean", label: "Animated Seed", default: true }
9006
- },
9007
- tags: ["glitch", "noise", "grain", "static"]
9008
- },
9009
- "old-film": {
9010
- id: "old-film",
9011
- name: "Old Film",
9012
- category: "cinematic",
9013
- description: "Simulates vintage cinema projector noise, sepia tint, vignette, and scratches.",
9014
- defaultParams: { sepia: 0.3, noise: 0.15, noiseSize: 1, scratchDensity: 0.3, scratchWidth: 1, vignetting: 0.3, vignettingAlpha: 1, vignettingBlur: 0.3 },
9015
- parameterSchema: {
9016
- sepia: { type: "number", label: "Sepia", min: 0, max: 1, default: 0.3, step: 0.05 },
9017
- noise: { type: "number", label: "Noise", min: 0, max: 1, default: 0.15, step: 0.05 },
9018
- noiseSize: { type: "number", label: "Noise Size", min: 0.2, max: 5, default: 1, step: 0.1 },
9019
- scratchDensity: { type: "number", label: "Scratch Density", min: 0, max: 1, default: 0.3, step: 0.05 },
9020
- scratchWidth: { type: "number", label: "Scratch Width", min: 0.5, max: 6, default: 1, step: 0.2 },
9021
- vignetting: { type: "number", label: "Vignette", min: 0, max: 1, default: 0.3, step: 0.05 },
9022
- vignettingAlpha: { type: "number", label: "Vignette Alpha", min: 0, max: 1, default: 1, step: 0.05 },
9023
- vignettingBlur: { type: "number", label: "Vignette Blur", min: 0, max: 1, default: 0.3, step: 0.05 }
9024
- },
9025
- tags: ["cinematic", "film", "vintage", "retro", "scratches"]
9026
- },
9027
- "displacement": {
9028
- id: "displacement",
9029
- name: "Displacement Map",
9030
- category: "distortion",
9031
- description: "Warp and distort the frame using a procedural noise displacement sprite.",
9032
- defaultParams: { scaleX: 20, scaleY: 20, animated: true, speed: 1 },
9033
- parameterSchema: {
9034
- scaleX: { type: "number", label: "Scale X", min: -200, max: 200, default: 20, step: 1 },
9035
- scaleY: { type: "number", label: "Scale Y", min: -200, max: 200, default: 20, step: 1 },
9036
- animated: { type: "boolean", label: "Flow Motion", default: true },
9037
- speed: { type: "number", label: "Speed", min: 0.1, max: 5, default: 1, step: 0.1 }
9038
- },
9039
- tags: ["distortion", "displacement", "warp", "liquid"]
9040
- },
9041
- "outline": {
9042
- id: "outline",
9043
- name: "Outline Overlay",
9044
- category: "distortion",
9045
- description: "Draws a solid colored outline around the non-transparent boundaries.",
9046
- defaultParams: { thickness: 3, color: "#7C6FFF", quality: 0.1, alpha: 1 },
9047
- parameterSchema: {
9048
- thickness: { type: "number", label: "Thickness", min: 0, max: 20, default: 3, step: 1 },
9049
- color: { type: "color", label: "Color", default: "#7C6FFF" },
9050
- quality: { type: "number", label: "Quality", min: 0.01, max: 1, default: 0.1, step: 0.05 },
9051
- alpha: { type: "number", label: "Alpha", min: 0, max: 1, default: 1, step: 0.05 }
9052
- },
9053
- tags: ["distortion", "outline", "stroke", "border"]
9054
- },
9055
- "grayscale": {
9056
- id: "grayscale",
9057
- name: "Grayscale",
9058
- category: "cinematic",
9059
- description: "Converts the layer to monochrome black and white.",
9060
- defaultParams: {},
9061
- parameterSchema: {},
9062
- tags: ["cinematic", "grayscale", "monochrome", "bw"]
9063
- },
9064
- "dot": {
9065
- id: "dot",
9066
- name: "Halftone Dots",
9067
- category: "distortion",
9068
- description: "Halftone dot raster pattern, simulating newspaper or comic book prints.",
9069
- defaultParams: { scale: 1, angle: 1, grayscale: true },
9070
- parameterSchema: {
9071
- scale: { type: "number", label: "Dot Scale", min: 0.1, max: 10, default: 1, step: 0.1 },
9072
- angle: { type: "number", label: "Angle", min: 0, max: 6.28, default: 1, step: 0.05 },
9073
- grayscale: { type: "boolean", label: "Grayscale", default: true }
9074
- },
9075
- tags: ["distortion", "dot", "halftone", "comic"]
9076
- },
9077
- "emboss": {
9078
- id: "emboss",
9079
- name: "Emboss Relief",
9080
- category: "distortion",
9081
- description: "Simulates an embossed 3D relief depth on the frame.",
9082
- defaultParams: { strength: 5 },
9083
- parameterSchema: {
9084
- strength: { type: "number", label: "Strength", min: 0, max: 20, default: 5, step: 0.5 }
9085
- },
9086
- tags: ["distortion", "emboss", "relief"]
9087
- },
9088
- "cross-hatch": {
9089
- id: "cross-hatch",
9090
- name: "Cross Hatch Sketch",
9091
- category: "distortion",
9092
- description: "Simulates a crosshatched pencil sketch on paper.",
9093
- defaultParams: {},
9094
- parameterSchema: {},
9095
- tags: ["distortion", "sketch", "drawing", "hatch"]
9096
- },
9097
- "pixelate": {
9098
- id: "pixelate",
9099
- name: "Pixelate Mosaic",
9100
- category: "distortion",
9101
- description: "Pixelate the video frame into large blocky mosaic cells.",
9102
- defaultParams: { sizeX: 10, sizeY: 10 },
9103
- parameterSchema: {
9104
- sizeX: { type: "number", label: "Cell Width", min: 1, max: 200, default: 10, step: 1 },
9105
- sizeY: { type: "number", label: "Cell Height", min: 1, max: 200, default: 10, step: 1 }
9106
- },
9107
- tags: ["distortion", "pixelate", "mosaic", "8bit"]
9108
- },
9109
- "ascii": {
9110
- id: "ascii",
9111
- name: "ASCII Art",
9112
- category: "distortion",
9113
- description: "Converts the video frame into interactive retro matrix ASCII text characters.",
9114
- defaultParams: { size: 8, replaceColor: false },
9115
- parameterSchema: {
9116
- size: { type: "number", label: "Char Size", min: 2, max: 50, default: 8, step: 1 },
9117
- replaceColor: { type: "boolean", label: "Replace Color", default: false }
9118
- },
9119
- tags: ["distortion", "ascii", "text", "terminal"]
8342
+ tags: ["retro", "pixelate", "mosaic", "8bit", "censorship"]
9120
8343
  }
9121
8344
  };
9122
- function drawBodySilhouette(ctx, cx, cy, w, h) {
9123
- ctx.beginPath();
9124
- ctx.ellipse(cx, cy - h * 0.22, w * 0.28, w * 0.28, 0, 0, Math.PI * 2);
9125
- ctx.rect(cx - w * 0.08, cy - h * 0.1, w * 0.16, h * 0.06);
9126
- ctx.moveTo(cx - w * 0.5, cy - h * 0.04);
9127
- ctx.quadraticCurveTo(cx - w * 0.4, cy - h * 0.08, cx, cy - h * 0.08);
9128
- ctx.quadraticCurveTo(cx + w * 0.4, cy - h * 0.08, cx + w * 0.5, cy - h * 0.04);
9129
- ctx.lineTo(cx + w * 0.45, cy + h * 0.4);
9130
- ctx.lineTo(cx - w * 0.45, cy + h * 0.4);
9131
- ctx.closePath();
9132
- }
9133
- function imageDataToCanvas(imageData) {
9134
- const canvas = typeof OffscreenCanvas !== "undefined" ? new OffscreenCanvas(imageData.width, imageData.height) : document.createElement("canvas");
9135
- if (canvas instanceof HTMLCanvasElement) {
9136
- canvas.width = imageData.width;
9137
- canvas.height = imageData.height;
9138
- }
9139
- const ctx = canvas.getContext("2d");
9140
- if (ctx) {
9141
- ctx.putImageData(imageData, 0, 0);
9142
- }
9143
- return canvas;
9144
- }
9145
- function pseudoRandom(seed) {
9146
- const x = Math.sin(seed * 12.9898) * 43758.5453;
9147
- return x - Math.floor(x);
9148
- }
9149
- function renderBodyGlow(ctx, params, intensity, time, bodyMask) {
9150
- const canvas = ctx.canvas;
9151
- const glowColor = params.glowColor || "#7C6FFF";
9152
- const glowRadius = (params.glowRadius ?? 20) * intensity * (1 + Math.sin(time * 3) * 0.2);
9153
- const glowIntensity = (params.glowIntensity ?? 0.8) * intensity * 0.18;
9154
- ctx.save();
9155
- ctx.globalCompositeOperation = "screen";
9156
- ctx.shadowColor = glowColor;
9157
- ctx.shadowBlur = glowRadius;
9158
- ctx.fillStyle = glowColor;
9159
- ctx.strokeStyle = glowColor;
9160
- ctx.lineWidth = 2;
9161
- ctx.globalAlpha = glowIntensity;
9162
- if (bodyMask) {
9163
- const maskCanvas = imageDataToCanvas(bodyMask);
9164
- ctx.drawImage(maskCanvas, 0, 0, canvas.width, canvas.height);
9165
- } else {
9166
- const cx = canvas.width / 2;
9167
- const cy = canvas.height * 0.5;
9168
- const w = canvas.width * 0.28;
9169
- const h = canvas.height * 0.52;
9170
- drawBodySilhouette(ctx, cx, cy, w, h);
9171
- ctx.fill();
9172
- ctx.stroke();
9173
- }
9174
- ctx.restore();
9175
- }
9176
- function renderBodyOutline(ctx, params, intensity, time, bodyMask) {
9177
- const canvas = ctx.canvas;
9178
- const outlineColor = params.outlineColor || "#00E5FF";
9179
- const pulseWidth = (params.outlineWidth ?? 6) * intensity * (1 + Math.sin(time * 2.5) * 0.15);
9180
- const feather = (params.feather ?? 15) * (1 + Math.sin(time * 2) * 0.15);
9181
- ctx.save();
9182
- ctx.globalCompositeOperation = "screen";
9183
- ctx.globalAlpha = Math.min(1, intensity);
9184
- if (bodyMask) {
9185
- const maskCanvas = imageDataToCanvas(bodyMask);
9186
- const maskCtx = maskCanvas.getContext("2d");
9187
- if (maskCtx) {
9188
- maskCtx.save();
9189
- maskCtx.globalCompositeOperation = "source-in";
9190
- maskCtx.fillStyle = outlineColor;
9191
- maskCtx.fillRect(0, 0, maskCanvas.width, maskCanvas.height);
9192
- maskCtx.restore();
9193
- }
9194
- ctx.filter = `blur(${pulseWidth}px)`;
9195
- ctx.drawImage(maskCanvas, 0, 0, canvas.width, canvas.height);
9196
- ctx.filter = "none";
9197
- ctx.drawImage(maskCanvas, -pulseWidth * 0.5, 0, canvas.width, canvas.height);
9198
- ctx.drawImage(maskCanvas, pulseWidth * 0.5, 0, canvas.width, canvas.height);
9199
- ctx.drawImage(maskCanvas, 0, -pulseWidth * 0.5, canvas.width, canvas.height);
9200
- ctx.drawImage(maskCanvas, 0, pulseWidth * 0.5, canvas.width, canvas.height);
9201
- } else {
9202
- ctx.strokeStyle = outlineColor;
9203
- ctx.lineWidth = Math.max(1, pulseWidth);
9204
- ctx.shadowColor = outlineColor;
9205
- ctx.shadowBlur = feather;
9206
- const cx = canvas.width / 2;
9207
- const cy = canvas.height * 0.5;
9208
- const w = canvas.width * 0.28;
9209
- const h = canvas.height * 0.52;
9210
- drawBodySilhouette(ctx, cx, cy, w, h);
9211
- ctx.stroke();
9212
- }
9213
- ctx.restore();
9214
- }
9215
- function renderBodyParticles(ctx, params, intensity, time, bodyMask) {
9216
- const canvas = ctx.canvas;
9217
- const particleColor = params.particleColor || "#FF2A85";
9218
- const count = Math.min(150, (params.particleCount ?? 60) * intensity);
9219
- const size = params.particleSize ?? 3;
9220
- const drift = params.drift ?? 8;
9221
- ctx.save();
9222
- ctx.globalCompositeOperation = "screen";
9223
- ctx.fillStyle = particleColor;
9224
- if (bodyMask) {
9225
- ctx.globalAlpha = Math.min(0.85, 0.25 + intensity * 0.6);
9226
- const seed = Math.floor(time * 24);
9227
- for (let i = 0; i < count; i++) {
9228
- const x = Math.floor(pseudoRandom(seed + i * 37) * canvas.width);
9229
- const y = Math.floor(pseudoRandom(seed + i * 43) * canvas.height);
9230
- const maskIdx = (Math.floor(y * bodyMask.height / canvas.height) * bodyMask.width + Math.floor(x * bodyMask.width / canvas.width)) * 4 + 3;
9231
- if (bodyMask.data[maskIdx] < 64) continue;
9232
- const xDrift = Math.sin((time + i) * 2.1) * drift * intensity;
9233
- const pSize = 1 + pseudoRandom(seed + i * 53) * (size - 1);
9234
- ctx.beginPath();
9235
- ctx.arc(x + xDrift, y - pseudoRandom(seed + i * 59) * 20 * intensity, pSize, 0, Math.PI * 2);
9236
- ctx.fill();
9237
- }
9238
- } else {
9239
- const cx = canvas.width / 2;
9240
- const cy = canvas.height * 0.5;
9241
- const w = canvas.width * 0.28;
9242
- const h = canvas.height * 0.52;
9243
- for (let i = 0; i < count; i++) {
9244
- const angle = i / count * Math.PI * 2;
9245
- const radius = 0.8 + Math.sin(angle * 3) * 0.15;
9246
- const px = cx + Math.cos(angle + time * 0.2) * w * radius;
9247
- const py = cy + Math.sin(angle + time * 0.2) * h * radius;
9248
- const dy = -((time * 25 + i * 4) % 35);
9249
- const dx = Math.sin(time * 1.5 + i * 0.6) * drift;
9250
- ctx.globalAlpha = 0.2 + 0.6 * (0.5 + 0.5 * Math.sin(time * 3 + i));
9251
- ctx.beginPath();
9252
- ctx.arc(px + dx, py + dy, size, 0, Math.PI * 2);
9253
- ctx.fill();
9254
- }
9255
- }
9256
- ctx.restore();
9257
- }
9258
- function renderBodySegmentationGlow(ctx, params, intensity, time, bodyMask) {
9259
- const canvas = ctx.canvas;
9260
- const glowColor = params.glowColor || "#FFD700";
9261
- const glowRadius = (params.glowRadius ?? 25) * intensity;
9262
- ctx.save();
9263
- ctx.globalCompositeOperation = "source-over";
9264
- ctx.shadowColor = glowColor;
9265
- ctx.shadowBlur = glowRadius;
9266
- ctx.fillStyle = glowColor;
9267
- ctx.globalAlpha = 0.12 * intensity;
9268
- if (bodyMask) {
9269
- const maskCanvas = imageDataToCanvas(bodyMask);
9270
- ctx.drawImage(maskCanvas, 0, 0, canvas.width, canvas.height);
9271
- } else {
9272
- const cx = canvas.width / 2;
9273
- const cy = canvas.height * 0.5;
9274
- const w = canvas.width * 0.28;
9275
- const h = canvas.height * 0.52;
9276
- drawBodySilhouette(ctx, cx, cy, w, h);
9277
- ctx.fill();
9278
- }
9279
- ctx.restore();
9280
- }
9281
8345
  function getEffectMetadata(id) {
9282
8346
  return EFFECTS_REGISTRY[id];
9283
8347
  }
@@ -9285,163 +8349,8 @@ function getEffectsByCategory(category) {
9285
8349
  return Object.values(EFFECTS_REGISTRY).filter((effect) => effect.category === category);
9286
8350
  }
9287
8351
  function getEffectRenderer(id) {
9288
- const renderers = {
9289
- // Light
9290
- flash: renderFlash,
9291
- flicker: renderFlicker,
9292
- vignette: renderVignette,
9293
- glow: renderGlow,
9294
- light_leak: renderLightLeak,
9295
- light_leak_2: renderLightLeak2,
9296
- fire: renderFire,
9297
- particles: renderParticles,
9298
- dust_particles: renderDustParticles,
9299
- // Body
9300
- body_glow: renderBodyGlow,
9301
- body_outline: renderBodyOutline,
9302
- body_particles: renderBodyParticles,
9303
- "body-segmentation-glow": renderBodySegmentationGlow,
9304
- // Normalized aliases retained for existing saved projects.
9305
- "light-leak": renderLightLeak,
9306
- "lens-flare": renderLightLeak2,
9307
- "lens_flare": renderLightLeak2,
9308
- "rgb-split": (ctx, params, intensity) => {
9309
- const shift = Math.floor(Number(params.redX ?? 4) * intensity);
9310
- if (shift === 0) return;
9311
- ctx.save();
9312
- ctx.globalCompositeOperation = "screen";
9313
- ctx.globalAlpha = 0.4 * intensity;
9314
- ctx.drawImage(ctx.canvas, -shift, 0);
9315
- ctx.drawImage(ctx.canvas, shift, 0);
9316
- ctx.restore();
9317
- },
9318
- "rgb_split": (ctx, params, intensity) => {
9319
- const shift = Math.floor(Number(params.redX ?? 4) * intensity);
9320
- if (shift === 0) return;
9321
- ctx.save();
9322
- ctx.globalCompositeOperation = "screen";
9323
- ctx.globalAlpha = 0.4 * intensity;
9324
- ctx.drawImage(ctx.canvas, -shift, 0);
9325
- ctx.drawImage(ctx.canvas, shift, 0);
9326
- ctx.restore();
9327
- },
9328
- "vhs": (ctx, params, intensity) => {
9329
- const width = ctx.canvas.width;
9330
- const height = ctx.canvas.height;
9331
- ctx.save();
9332
- ctx.fillStyle = `rgba(0, 0, 0, ${intensity * 0.15})`;
9333
- for (let y = 0; y < height; y += 4) {
9334
- ctx.fillRect(0, y, width, 1.5);
9335
- }
9336
- ctx.restore();
9337
- },
9338
- "glitch-band": (ctx, params, intensity) => {
9339
- const width = ctx.canvas.width;
9340
- const height = ctx.canvas.height;
9341
- const y = Math.floor(Math.random() * height);
9342
- ctx.save();
9343
- ctx.fillStyle = `rgba(255, 255, 255, ${intensity * 0.35})`;
9344
- ctx.fillRect(0, y, width, 8);
9345
- ctx.restore();
9346
- },
9347
- "glitch_band": (ctx, params, intensity) => {
9348
- const width = ctx.canvas.width;
9349
- const height = ctx.canvas.height;
9350
- const y = Math.floor(Math.random() * height);
9351
- ctx.save();
9352
- ctx.fillStyle = `rgba(255, 255, 255, ${intensity * 0.35})`;
9353
- ctx.fillRect(0, y, width, 8);
9354
- ctx.restore();
9355
- },
9356
- "crt": (ctx, params, intensity) => {
9357
- const width = ctx.canvas.width;
9358
- const height = ctx.canvas.height;
9359
- ctx.save();
9360
- ctx.fillStyle = `rgba(0, 0, 0, ${intensity * 0.12})`;
9361
- for (let y = 0; y < height; y += 3) {
9362
- ctx.fillRect(0, y, width, 1);
9363
- }
9364
- ctx.restore();
9365
- },
9366
- "film-grain": (ctx, params, intensity) => {
9367
- const width = ctx.canvas.width;
9368
- const height = ctx.canvas.height;
9369
- ctx.save();
9370
- for (let i = 0; i < 120 * intensity; i++) {
9371
- const x = Math.random() * width;
9372
- const y = Math.random() * height;
9373
- const alpha2 = 0.04 + Math.random() * 0.05;
9374
- ctx.fillStyle = Math.random() > 0.5 ? `rgba(255, 255, 255, ${alpha2})` : `rgba(0, 0, 0, ${alpha2})`;
9375
- ctx.fillRect(x, y, 2, 2);
9376
- }
9377
- ctx.restore();
9378
- },
9379
- "film_grain": (ctx, params, intensity) => {
9380
- const width = ctx.canvas.width;
9381
- const height = ctx.canvas.height;
9382
- ctx.save();
9383
- for (let i = 0; i < 120 * intensity; i++) {
9384
- const x = Math.random() * width;
9385
- const y = Math.random() * height;
9386
- const alpha2 = 0.04 + Math.random() * 0.05;
9387
- ctx.fillStyle = Math.random() > 0.5 ? `rgba(255, 255, 255, ${alpha2})` : `rgba(0, 0, 0, ${alpha2})`;
9388
- ctx.fillRect(x, y, 2, 2);
9389
- }
9390
- ctx.restore();
9391
- },
9392
- "tilt-shift": (ctx, params, intensity) => {
9393
- ctx.save();
9394
- try {
9395
- ctx.filter = `blur(${Math.max(1, Math.floor(6 * intensity))}px)`;
9396
- ctx.drawImage(ctx.canvas, 0, 0);
9397
- } catch {
9398
- }
9399
- ctx.restore();
9400
- },
9401
- "tilt_shift": (ctx, params, intensity) => {
9402
- ctx.save();
9403
- try {
9404
- ctx.filter = `blur(${Math.max(1, Math.floor(6 * intensity))}px)`;
9405
- ctx.drawImage(ctx.canvas, 0, 0);
9406
- } catch {
9407
- }
9408
- ctx.restore();
9409
- },
9410
- "cinematic-lut": (ctx, params, intensity) => {
9411
- const width = ctx.canvas.width;
9412
- const height = ctx.canvas.height;
9413
- ctx.save();
9414
- ctx.globalCompositeOperation = "color";
9415
- ctx.fillStyle = `rgba(255, 140, 0, ${intensity * 0.18})`;
9416
- ctx.fillRect(0, 0, width, height);
9417
- ctx.restore();
9418
- },
9419
- "cinematic_lut": (ctx, params, intensity) => {
9420
- const width = ctx.canvas.width;
9421
- const height = ctx.canvas.height;
9422
- ctx.save();
9423
- ctx.globalCompositeOperation = "color";
9424
- ctx.fillStyle = `rgba(255, 140, 0, ${intensity * 0.18})`;
9425
- ctx.fillRect(0, 0, width, height);
9426
- ctx.restore();
9427
- },
9428
- "motion-blur": (ctx, params, intensity) => {
9429
- ctx.save();
9430
- ctx.globalAlpha = 0.4 * intensity;
9431
- const shiftX = Math.floor(Number(params.velocityX ?? 20) * intensity * 0.2);
9432
- const shiftY = Math.floor(Number(params.velocityY ?? 0) * intensity * 0.2);
9433
- ctx.drawImage(ctx.canvas, shiftX, shiftY);
9434
- ctx.restore();
9435
- },
9436
- "motion_blur": (ctx, params, intensity) => {
9437
- ctx.save();
9438
- ctx.globalAlpha = 0.4 * intensity;
9439
- const shiftX = Math.floor(Number(params.velocityX ?? 20) * intensity * 0.2);
9440
- const shiftY = Math.floor(Number(params.velocityY ?? 0) * intensity * 0.2);
9441
- ctx.drawImage(ctx.canvas, shiftX, shiftY);
9442
- ctx.restore();
9443
- },
9444
- "shockwave": (ctx, params, intensity, time) => {
8352
+ if (id === "shockwave") {
8353
+ return (ctx, _params, intensity, time) => {
9445
8354
  const width = ctx.canvas.width;
9446
8355
  const height = ctx.canvas.height;
9447
8356
  ctx.save();
@@ -9451,337 +8360,15 @@ function getEffectRenderer(id) {
9451
8360
  ctx.arc(width / 2, height / 2, time * 160 % (width / 2 + 50), 0, Math.PI * 2);
9452
8361
  ctx.stroke();
9453
8362
  ctx.restore();
9454
- },
9455
- "bulge-pinch": (ctx, params, intensity) => {
9456
- const width = ctx.canvas.width;
9457
- const height = ctx.canvas.height;
9458
- ctx.save();
9459
- ctx.translate(width / 2, height / 2);
9460
- const scale = 1 + Number(params.strength ?? 0.5) * intensity * 0.08;
9461
- ctx.scale(scale, scale);
9462
- ctx.drawImage(ctx.canvas, -width / 2, -height / 2);
9463
- ctx.restore();
9464
- },
9465
- "bulge_pinch": (ctx, params, intensity) => {
9466
- const width = ctx.canvas.width;
9467
- const height = ctx.canvas.height;
9468
- ctx.save();
9469
- ctx.translate(width / 2, height / 2);
9470
- const scale = 1 + Number(params.strength ?? 0.5) * intensity * 0.08;
9471
- ctx.scale(scale, scale);
9472
- ctx.drawImage(ctx.canvas, -width / 2, -height / 2);
9473
- ctx.restore();
9474
- },
9475
- "twist": (ctx, params, intensity) => {
9476
- const width = ctx.canvas.width;
9477
- const height = ctx.canvas.height;
9478
- ctx.save();
9479
- ctx.translate(width / 2, height / 2);
9480
- ctx.rotate(Number(params.angle ?? 4) * intensity * 0.02);
9481
- ctx.drawImage(ctx.canvas, -width / 2, -height / 2);
9482
- ctx.restore();
9483
- },
9484
- "reflection": (ctx, params, intensity) => {
9485
- const width = ctx.canvas.width;
9486
- const height = ctx.canvas.height;
9487
- const boundaryY = Number(params.boundary ?? 0.5) * height;
9488
- ctx.save();
9489
- ctx.translate(0, boundaryY * 2);
9490
- ctx.scale(1, -1);
9491
- ctx.globalAlpha = 0.7 * intensity;
9492
- ctx.drawImage(ctx.canvas, 0, boundaryY, width, height - boundaryY, 0, boundaryY, width, height - boundaryY);
9493
- ctx.restore();
9494
- },
9495
- "color-gradient": (ctx, params, intensity) => {
9496
- const width = ctx.canvas.width;
9497
- const height = ctx.canvas.height;
9498
- ctx.save();
9499
- const grad = params.gradientType === 1 ? ctx.createRadialGradient(width / 2, height / 2, 10, width / 2, height / 2, Math.max(width, height) / 2) : ctx.createLinearGradient(0, 0, width, height);
9500
- grad.addColorStop(0, params.color1 || "#7C6FFF");
9501
- grad.addColorStop(1, params.color2 || "#0E0E12");
9502
- ctx.fillStyle = grad;
9503
- ctx.globalAlpha = Number(params.alpha ?? 0.5) * intensity;
9504
- ctx.fillRect(0, 0, width, height);
9505
- ctx.restore();
9506
- },
9507
- "color-overlay": (ctx, params, intensity) => {
9508
- const width = ctx.canvas.width;
9509
- const height = ctx.canvas.height;
9510
- ctx.save();
9511
- ctx.fillStyle = params.color || "#7C6FFF";
9512
- ctx.globalAlpha = Number(params.alpha ?? 0.3) * intensity;
9513
- ctx.fillRect(0, 0, width, height);
9514
- ctx.restore();
9515
- },
9516
- "color-adjustments": (ctx, params, intensity) => {
9517
- const width = ctx.canvas.width;
9518
- const height = ctx.canvas.height;
9519
- const f = intensity;
9520
- const exp = Number(params.exposure ?? 0) * f;
9521
- const brightnessVal = 1 + Number(params.brightness ?? 0) * f + exp;
9522
- const contrastVal = 1 + Number(params.contrast ?? 0) * f;
9523
- const saturationVal = 1 + Number(params.saturation ?? 0) * f;
9524
- const sepiaVal = Number(params.sepia ?? 0) * f;
9525
- const grayscaleVal = Number(params.grayscale ?? 0) * f;
9526
- const hueVal = Number(params.hueRotate ?? 0) * f;
9527
- const invertVal = Number(params.invert ?? 0) * f;
9528
- const blurVal = Number(params.blur ?? 0) * f;
9529
- const filterParts = [];
9530
- if (brightnessVal !== 1) filterParts.push(`brightness(${brightnessVal})`);
9531
- if (contrastVal !== 1) filterParts.push(`contrast(${contrastVal})`);
9532
- if (saturationVal !== 1) filterParts.push(`saturate(${saturationVal})`);
9533
- if (sepiaVal > 0) filterParts.push(`sepia(${sepiaVal * 100}%)`);
9534
- if (grayscaleVal > 0) filterParts.push(`grayscale(${grayscaleVal * 100}%)`);
9535
- if (hueVal !== 0) filterParts.push(`hue-rotate(${hueVal * 180 / Math.PI}deg)`);
9536
- if (invertVal > 0) filterParts.push(`invert(${invertVal * 100}%)`);
9537
- if (blurVal > 0) filterParts.push(`blur(${blurVal}px)`);
9538
- if (filterParts.length > 0) {
9539
- ctx.save();
9540
- const temp = document.createElement("canvas");
9541
- temp.width = width;
9542
- temp.height = height;
9543
- const tempCtx = temp.getContext("2d");
9544
- if (tempCtx) {
9545
- tempCtx.drawImage(ctx.canvas, 0, 0);
9546
- ctx.clearRect(0, 0, width, height);
9547
- ctx.filter = filterParts.join(" ");
9548
- ctx.drawImage(temp, 0, 0);
9549
- ctx.filter = "none";
9550
- }
9551
- ctx.restore();
9552
- }
9553
- const tempVal = Number(params.temperature ?? 0) * f;
9554
- if (tempVal !== 0) {
9555
- ctx.save();
9556
- ctx.globalCompositeOperation = "soft-light";
9557
- if (tempVal > 0) {
9558
- ctx.fillStyle = `rgba(255, 140, 40, ${tempVal})`;
9559
- } else {
9560
- ctx.fillStyle = `rgba(40, 120, 255, ${-tempVal})`;
9561
- }
9562
- ctx.fillRect(0, 0, width, height);
9563
- ctx.restore();
9564
- }
9565
- const tintVal = Number(params.tint ?? 0) * f;
9566
- if (tintVal !== 0) {
9567
- ctx.save();
9568
- ctx.globalCompositeOperation = "soft-light";
9569
- if (tintVal > 0) {
9570
- ctx.fillStyle = `rgba(255, 40, 180, ${tintVal})`;
9571
- } else {
9572
- ctx.fillStyle = `rgba(40, 255, 100, ${-tintVal})`;
9573
- }
9574
- ctx.fillRect(0, 0, width, height);
9575
- ctx.restore();
9576
- }
9577
- const vignetteVal = Number(params.vignette ?? 0) * f;
9578
- if (vignetteVal > 0) {
9579
- ctx.save();
9580
- ctx.globalCompositeOperation = "multiply";
9581
- const cx = width / 2;
9582
- const cy = height / 2;
9583
- const maxRadius = Math.sqrt(cx * cx + cy * cy);
9584
- const gradient = ctx.createRadialGradient(cx, cy, maxRadius * 0.45, cx, cy, maxRadius * 1);
9585
- gradient.addColorStop(0, "rgba(0, 0, 0, 0)");
9586
- gradient.addColorStop(0.5, `rgba(0, 0, 0, ${vignetteVal * 0.15})`);
9587
- gradient.addColorStop(0.8, `rgba(0, 0, 0, ${vignetteVal * 0.55})`);
9588
- gradient.addColorStop(1, `rgba(0, 0, 0, ${vignetteVal * 0.9})`);
9589
- ctx.fillStyle = gradient;
9590
- ctx.fillRect(0, 0, width, height);
9591
- ctx.restore();
9592
- }
9593
- },
9594
- "hsl-adjustment": (ctx, params, intensity) => {
9595
- if (params.colorize) {
9596
- ctx.save();
9597
- ctx.fillStyle = "rgba(124, 111, 255, 0.2)";
9598
- ctx.globalAlpha = Number(params.alpha ?? 1) * intensity;
9599
- ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
9600
- ctx.restore();
9601
- }
9602
- },
9603
- "alpha": (ctx, params, intensity) => {
9604
- ctx.save();
9605
- ctx.globalAlpha = 1 - (1 - Number(params.alpha ?? 1)) * intensity;
9606
- ctx.restore();
9607
- },
9608
- "color-matrix": (ctx, params, intensity) => {
9609
- ctx.save();
9610
- ctx.globalCompositeOperation = "color";
9611
- ctx.fillStyle = `rgba(255, 120, 0, ${0.1 * intensity})`;
9612
- ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
9613
- ctx.restore();
9614
- },
9615
- "neon-glow": (ctx, params, intensity) => {
9616
- ctx.save();
9617
- ctx.shadowBlur = Number(params.distance ?? 15) * intensity;
9618
- ctx.shadowColor = params.color || "#7C6FFF";
9619
- ctx.restore();
9620
- },
9621
- "gaussian-blur": (ctx, params, intensity) => {
9622
- ctx.save();
9623
- try {
9624
- ctx.filter = `blur(${Math.max(1, Math.floor(Number(params.blur ?? 8) * intensity))}px)`;
9625
- ctx.drawImage(ctx.canvas, 0, 0);
9626
- } catch {
9627
- }
9628
- ctx.restore();
9629
- },
9630
- "kawase-blur": (ctx, params, intensity) => {
9631
- ctx.save();
9632
- try {
9633
- ctx.filter = `blur(${Math.max(1, Math.floor(Number(params.blur ?? 8) * intensity))}px)`;
9634
- ctx.drawImage(ctx.canvas, 0, 0);
9635
- } catch {
9636
- }
9637
- ctx.restore();
9638
- },
9639
- "zoom-blur": (ctx, params, intensity) => {
9640
- ctx.save();
9641
- try {
9642
- ctx.filter = `blur(${Math.max(1, Math.floor(4 * intensity))}px)`;
9643
- ctx.drawImage(ctx.canvas, 0, 0);
9644
- } catch {
9645
- }
9646
- ctx.restore();
9647
- },
9648
- "radial-blur": (ctx, params, intensity) => {
9649
- ctx.save();
9650
- try {
9651
- ctx.filter = `blur(${Math.max(1, Math.floor(4 * intensity))}px)`;
9652
- ctx.drawImage(ctx.canvas, 0, 0);
9653
- } catch {
9654
- }
9655
- ctx.restore();
9656
- },
9657
- "drop-shadow": (ctx, params, intensity) => {
9658
- ctx.save();
9659
- ctx.shadowBlur = Number(params.blur ?? 4) * intensity;
9660
- ctx.shadowColor = params.color || "#000000";
9661
- ctx.shadowOffsetX = Number(params.offsetX ?? 4) * intensity;
9662
- ctx.shadowOffsetY = Number(params.offsetY ?? 4) * intensity;
9663
- ctx.restore();
9664
- },
9665
- "static-noise": (ctx, params, intensity) => {
9666
- const width = ctx.canvas.width;
9667
- const height = ctx.canvas.height;
9668
- ctx.save();
9669
- const density = Number(params.noise ?? 0.15) * intensity;
9670
- for (let i = 0; i < 200 * density; i++) {
9671
- const x = Math.random() * width;
9672
- const y = Math.random() * height;
9673
- ctx.fillStyle = `rgba(255, 255, 255, ${0.1 + Math.random() * 0.15})`;
9674
- ctx.fillRect(x, y, 2, 2);
9675
- }
9676
- ctx.restore();
9677
- },
9678
- "old-film": (ctx, params, intensity) => {
9679
- const width = ctx.canvas.width;
9680
- const height = ctx.canvas.height;
9681
- ctx.save();
9682
- ctx.globalCompositeOperation = "color";
9683
- ctx.fillStyle = `rgba(139, 69, 19, ${Number(params.sepia ?? 0.3) * intensity})`;
9684
- ctx.fillRect(0, 0, width, height);
9685
- ctx.globalCompositeOperation = "source-over";
9686
- for (let i = 0; i < 50 * intensity; i++) {
9687
- ctx.fillStyle = "rgba(255,255,255,0.06)";
9688
- ctx.fillRect(Math.random() * width, Math.random() * height, 2, 2);
9689
- }
9690
- ctx.restore();
9691
- },
9692
- "displacement": (ctx, params, intensity) => {
9693
- ctx.save();
9694
- const shiftX = Number(params.scaleX ?? 20) * intensity * 0.1;
9695
- const shiftY = Number(params.scaleY ?? 20) * intensity * 0.1;
9696
- ctx.drawImage(ctx.canvas, shiftX, shiftY);
9697
- ctx.restore();
9698
- },
9699
- "outline": (ctx, params, intensity) => {
9700
- ctx.save();
9701
- ctx.strokeStyle = params.color || "#7C6FFF";
9702
- ctx.lineWidth = Number(params.thickness ?? 3) * intensity;
9703
- ctx.strokeRect(0, 0, ctx.canvas.width, ctx.canvas.height);
9704
- ctx.restore();
9705
- },
9706
- "grayscale": (ctx, params, intensity) => {
9707
- ctx.save();
9708
- ctx.globalCompositeOperation = "luminosity";
9709
- ctx.fillStyle = "#ffffff";
9710
- ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
9711
- ctx.restore();
9712
- },
9713
- "dot": (ctx, params, intensity) => {
9714
- const width = ctx.canvas.width;
9715
- const height = ctx.canvas.height;
9716
- ctx.save();
9717
- ctx.fillStyle = "rgba(0,0,0,0.15)";
9718
- const step = Math.max(4, Math.floor(10 * Number(params.scale ?? 1)));
9719
- for (let x = 0; x < width; x += step) {
9720
- for (let y = 0; y < height; y += step) {
9721
- ctx.beginPath();
9722
- ctx.arc(x, y, 1.5 * intensity, 0, Math.PI * 2);
9723
- ctx.fill();
9724
- }
9725
- }
9726
- ctx.restore();
9727
- },
9728
- "emboss": (ctx, params, intensity) => {
9729
- ctx.save();
9730
- ctx.globalAlpha = 0.3 * intensity;
9731
- ctx.drawImage(ctx.canvas, 1, 1);
9732
- ctx.restore();
9733
- },
9734
- "cross-hatch": (ctx, params, intensity) => {
9735
- const width = ctx.canvas.width;
9736
- const height = ctx.canvas.height;
9737
- ctx.save();
9738
- ctx.strokeStyle = `rgba(0,0,0,${0.15 * intensity})`;
9739
- ctx.lineWidth = 1;
9740
- for (let i = 0; i < width; i += 20) {
9741
- ctx.beginPath();
9742
- ctx.moveTo(i, 0);
9743
- ctx.lineTo(i + height, height);
9744
- ctx.stroke();
9745
- }
9746
- ctx.restore();
9747
- },
9748
- "pixelate": (ctx, params, intensity) => {
9749
- const width = ctx.canvas.width;
9750
- const height = ctx.canvas.height;
9751
- const cellW = Math.max(2, Math.floor(Number(params.sizeX ?? 10) * intensity));
9752
- const cellH = Math.max(2, Math.floor(Number(params.sizeY ?? 10) * intensity));
9753
- ctx.save();
9754
- ctx.imageSmoothingEnabled = false;
9755
- const tempCanvas = document.createElement("canvas");
9756
- tempCanvas.width = Math.max(4, Math.floor(width / cellW));
9757
- tempCanvas.height = Math.max(4, Math.floor(height / cellH));
9758
- const tempCtx = tempCanvas.getContext("2d");
9759
- tempCtx.drawImage(ctx.canvas, 0, 0, tempCanvas.width, tempCanvas.height);
9760
- ctx.clearRect(0, 0, width, height);
9761
- ctx.drawImage(tempCanvas, 0, 0, tempCanvas.width, tempCanvas.height, 0, 0, width, height);
9762
- ctx.restore();
9763
- },
9764
- "ascii": (ctx, params, intensity) => {
9765
- const width = ctx.canvas.width;
9766
- const height = ctx.canvas.height;
9767
- const size = Math.max(4, Math.floor(Number(params.size ?? 8) * intensity));
9768
- ctx.save();
9769
- ctx.imageSmoothingEnabled = false;
9770
- const tempCanvas = document.createElement("canvas");
9771
- tempCanvas.width = Math.max(4, Math.floor(width / size));
9772
- tempCanvas.height = Math.max(4, Math.floor(height / size));
9773
- const tempCtx = tempCanvas.getContext("2d");
9774
- tempCtx.drawImage(ctx.canvas, 0, 0, tempCanvas.width, tempCanvas.height);
9775
- ctx.clearRect(0, 0, width, height);
9776
- ctx.drawImage(tempCanvas, 0, 0, tempCanvas.width, tempCanvas.height, 0, 0, width, height);
9777
- ctx.restore();
9778
- }
9779
- };
9780
- return renderers[id] || null;
8363
+ };
8364
+ }
8365
+ return null;
9781
8366
  }
9782
8367
  function searchEffects(query) {
9783
8368
  const lowerQuery = query.toLowerCase();
9784
- return Object.values(EFFECTS_REGISTRY).filter((effect) => effect.name.toLowerCase().includes(lowerQuery) || effect.description.toLowerCase().includes(lowerQuery) || effect.tags.some((tag) => tag.toLowerCase().includes(lowerQuery)));
8369
+ return Object.values(EFFECTS_REGISTRY).filter(
8370
+ (effect) => effect.name.toLowerCase().includes(lowerQuery) || effect.description.toLowerCase().includes(lowerQuery) || effect.tags.some((tag) => tag.toLowerCase().includes(lowerQuery))
8371
+ );
9785
8372
  }
9786
8373
 
9787
8374
  // src/videoEffects/EffectRenderer.ts
@@ -10068,6 +8655,36 @@ var EffectEngine = class {
10068
8655
  }
10069
8656
  };
10070
8657
 
8658
+ // src/videoEffects/utils/colorUtils.ts
8659
+ function hexToRgba(hex, alpha2) {
8660
+ hex = hex.replace("#", "");
8661
+ const r = parseInt(hex.substring(0, 2), 16);
8662
+ const g = parseInt(hex.substring(2, 4), 16);
8663
+ const b = parseInt(hex.substring(4, 6), 16);
8664
+ return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
8665
+ }
8666
+ function rgbaToComponents(rgba) {
8667
+ const match = rgba.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);
8668
+ if (!match) {
8669
+ return { r: 0, g: 0, b: 0, a: 1 };
8670
+ }
8671
+ return {
8672
+ r: parseInt(match[1]),
8673
+ g: parseInt(match[2]),
8674
+ b: parseInt(match[3]),
8675
+ a: match[4] ? parseFloat(match[4]) : 1
8676
+ };
8677
+ }
8678
+ function blendColors(color1, color2, ratio) {
8679
+ const c1 = rgbaToComponents(color1);
8680
+ const c2 = rgbaToComponents(color2);
8681
+ const r = Math.round(c1.r * (1 - ratio) + c2.r * ratio);
8682
+ const g = Math.round(c1.g * (1 - ratio) + c2.g * ratio);
8683
+ const b = Math.round(c1.b * (1 - ratio) + c2.b * ratio);
8684
+ const a = c1.a * (1 - ratio) + c2.a * ratio;
8685
+ return `rgba(${r}, ${g}, ${b}, ${a})`;
8686
+ }
8687
+
10071
8688
  // src/videoEffects/utils/canvasUtils.ts
10072
8689
  function addNoise(ctx, amount) {
10073
8690
  const width = ctx.canvas.width;
@@ -10190,59 +8807,6 @@ function generateEffectsManifest() {
10190
8807
  };
10191
8808
  }
10192
8809
 
10193
- // src/videoEffects/renderers/camera/index.ts
10194
- var camera_exports = {};
10195
- __export(camera_exports, {
10196
- renderDolly: () => renderDolly,
10197
- renderPan: () => renderPan,
10198
- renderRotate: () => renderRotate,
10199
- renderShake: () => renderShake,
10200
- renderZoom: () => renderZoom
10201
- });
10202
-
10203
- // src/videoEffects/renderers/camera/shake.ts
10204
- function renderShake(ctx, params, intensity, time) {
10205
- const shakeIntensity = (params.intensity || 50) * intensity;
10206
- const frequency = params.frequency || 10;
10207
- const offsetX = Math.sin(time * frequency) * shakeIntensity;
10208
- const offsetY = Math.cos(time * frequency * 1.3) * shakeIntensity;
10209
- ctx.translate(offsetX, offsetY);
10210
- }
10211
-
10212
- // src/videoEffects/renderers/camera/zoom.ts
10213
- function renderZoom(ctx, params, intensity, time) {
10214
- const scale = 1 + (params.scale || 0.2) * intensity;
10215
- const centerX = params.centerX || 0.5;
10216
- const centerY = params.centerY || 0.5;
10217
- const width = ctx.canvas.width;
10218
- const height = ctx.canvas.height;
10219
- ctx.translate(width * centerX, height * centerY);
10220
- ctx.scale(scale, scale);
10221
- ctx.translate(-width * centerX, -height * centerY);
10222
- }
10223
-
10224
- // src/videoEffects/renderers/camera/pan.ts
10225
- function renderPan(ctx, params, intensity, time) {
10226
- const panX = (params.panX || 0) * intensity;
10227
- const panY = (params.panY || 0) * intensity;
10228
- ctx.translate(panX, panY);
10229
- }
10230
-
10231
- // src/videoEffects/renderers/camera/rotate.ts
10232
- function renderRotate(ctx, params, intensity, time) {
10233
- const angle = (params.angle || 0) * intensity * (Math.PI / 180);
10234
- const width = ctx.canvas.width;
10235
- const height = ctx.canvas.height;
10236
- ctx.translate(width / 2, height / 2);
10237
- ctx.rotate(angle);
10238
- ctx.translate(-width / 2, -height / 2);
10239
- }
10240
-
10241
- // src/videoEffects/renderers/camera/dolly.ts
10242
- function renderDolly(ctx, params, intensity, time) {
10243
- renderZoom(ctx, params, intensity, time);
10244
- }
10245
-
10246
8810
  // src/transitions/TransitionRenderer.ts
10247
8811
  var TransitionRenderer = class {
10248
8812
  /**
@@ -13526,6 +12090,347 @@ var BUILTIN_CANVAS_TEMPLATES = [
13526
12090
  }
13527
12091
  }
13528
12092
  ]
12093
+ },
12094
+ // ── Caption Templates (Admin-Customizable Studio Presets) ────────────────────
12095
+ {
12096
+ id: "classic-yellow",
12097
+ label: "Classic Yellow",
12098
+ category: "caption",
12099
+ duration: 4,
12100
+ canvasWidth: 1920,
12101
+ canvasHeight: 1080,
12102
+ description: "High-contrast yellow text with bold black outline \u2014 the most readable caption style for mixed backgrounds.",
12103
+ layers: [
12104
+ {
12105
+ kind: "text",
12106
+ id: "caption-text",
12107
+ content: "Sample Subtitle Caption",
12108
+ fontFamily: "Outfit Variable",
12109
+ fontSize: 38,
12110
+ fontWeight: 800,
12111
+ color: "#FFE600",
12112
+ align: "center",
12113
+ x: 360,
12114
+ y: 890,
12115
+ width: 1200,
12116
+ height: 100,
12117
+ role: "primary",
12118
+ textRole: "caption",
12119
+ stroke: { color: "#000000", width: 4 },
12120
+ shadow: { color: "rgba(0,0,0,0.6)", blur: 6, offsetX: 0, offsetY: 3 },
12121
+ animation: {
12122
+ in: "fade",
12123
+ out: "fade",
12124
+ inDuration: 0.2,
12125
+ outDuration: 0.2,
12126
+ hold: "full"
12127
+ },
12128
+ anchor: {
12129
+ anchorPoint: "bottom-center",
12130
+ maxWidthPercentage: 90
12131
+ }
12132
+ }
12133
+ ]
12134
+ },
12135
+ {
12136
+ id: "dark-pill",
12137
+ label: "Dark Pill",
12138
+ category: "caption",
12139
+ duration: 4,
12140
+ canvasWidth: 1920,
12141
+ canvasHeight: 1080,
12142
+ description: "White text inside a semi-transparent dark rounded pill \u2014 works on any background.",
12143
+ layers: [
12144
+ {
12145
+ kind: "text",
12146
+ id: "caption-text",
12147
+ content: "Sample Subtitle Caption",
12148
+ fontFamily: "Inter Variable",
12149
+ fontSize: 34,
12150
+ fontWeight: 700,
12151
+ color: "#FFFFFF",
12152
+ align: "center",
12153
+ x: 360,
12154
+ y: 890,
12155
+ width: 1200,
12156
+ height: 100,
12157
+ role: "primary",
12158
+ textRole: "caption",
12159
+ backgroundColor: "rgba(0,0,0,0.75)",
12160
+ backgroundRadius: 10,
12161
+ padding: 10,
12162
+ paddingTop: 10,
12163
+ paddingBottom: 10,
12164
+ paddingLeft: 20,
12165
+ paddingRight: 20,
12166
+ shadow: { color: "rgba(0,0,0,0.5)", blur: 4, offsetX: 0, offsetY: 2 },
12167
+ animation: {
12168
+ in: "fade",
12169
+ out: "fade",
12170
+ inDuration: 0.2,
12171
+ outDuration: 0.2,
12172
+ hold: "full"
12173
+ },
12174
+ anchor: {
12175
+ anchorPoint: "bottom-center",
12176
+ maxWidthPercentage: 90
12177
+ }
12178
+ }
12179
+ ]
12180
+ },
12181
+ {
12182
+ id: "outline-white",
12183
+ label: "Outline White",
12184
+ category: "caption",
12185
+ duration: 4,
12186
+ canvasWidth: 1920,
12187
+ canvasHeight: 1080,
12188
+ description: "Broadcast-standard white text with dark outline \u2014 clean and professional on any content.",
12189
+ layers: [
12190
+ {
12191
+ kind: "text",
12192
+ id: "caption-text",
12193
+ content: "Sample Subtitle Caption",
12194
+ fontFamily: "Inter Variable",
12195
+ fontSize: 32,
12196
+ fontWeight: 600,
12197
+ color: "#FFFFFF",
12198
+ align: "center",
12199
+ x: 360,
12200
+ y: 890,
12201
+ width: 1200,
12202
+ height: 100,
12203
+ role: "primary",
12204
+ textRole: "caption",
12205
+ stroke: { color: "#1a1a1a", width: 3 },
12206
+ shadow: { color: "rgba(0,0,0,0.8)", blur: 5, offsetX: 0, offsetY: 2 },
12207
+ animation: {
12208
+ in: "fade",
12209
+ out: "fade",
12210
+ inDuration: 0.2,
12211
+ outDuration: 0.2,
12212
+ hold: "full"
12213
+ },
12214
+ anchor: {
12215
+ anchorPoint: "bottom-center",
12216
+ maxWidthPercentage: 90
12217
+ }
12218
+ }
12219
+ ]
12220
+ },
12221
+ {
12222
+ id: "neon-pop",
12223
+ label: "Neon Pop",
12224
+ category: "caption",
12225
+ duration: 4,
12226
+ canvasWidth: 1920,
12227
+ canvasHeight: 1080,
12228
+ description: "Electric cyan with a vivid blue glow \u2014 perfect for tech, gaming, and high-energy content.",
12229
+ layers: [
12230
+ {
12231
+ kind: "text",
12232
+ id: "caption-text",
12233
+ content: "Sample Subtitle Caption",
12234
+ fontFamily: "Outfit Variable",
12235
+ fontSize: 38,
12236
+ fontWeight: 800,
12237
+ color: "#00FFFF",
12238
+ align: "center",
12239
+ x: 360,
12240
+ y: 890,
12241
+ width: 1200,
12242
+ height: 100,
12243
+ role: "primary",
12244
+ textRole: "caption",
12245
+ stroke: { color: "#0044EE", width: 3 },
12246
+ shadow: { color: "rgba(0,68,238,0.5)", blur: 10, offsetX: 0, offsetY: 0 },
12247
+ animation: {
12248
+ in: "fade",
12249
+ out: "fade",
12250
+ inDuration: 0.2,
12251
+ outDuration: 0.2,
12252
+ hold: "full"
12253
+ },
12254
+ anchor: {
12255
+ anchorPoint: "bottom-center",
12256
+ maxWidthPercentage: 90
12257
+ }
12258
+ }
12259
+ ]
12260
+ },
12261
+ {
12262
+ id: "minimal-clean",
12263
+ label: "Minimal Clean",
12264
+ category: "caption",
12265
+ duration: 4,
12266
+ canvasWidth: 1920,
12267
+ canvasHeight: 1080,
12268
+ description: "Understated white text with a soft shadow \u2014 editorial and podcast-friendly.",
12269
+ layers: [
12270
+ {
12271
+ kind: "text",
12272
+ id: "caption-text",
12273
+ content: "Sample Subtitle Caption",
12274
+ fontFamily: "Inter Variable",
12275
+ fontSize: 30,
12276
+ fontWeight: 400,
12277
+ color: "#FFFFFF",
12278
+ align: "center",
12279
+ x: 360,
12280
+ y: 890,
12281
+ width: 1200,
12282
+ height: 100,
12283
+ role: "primary",
12284
+ textRole: "caption",
12285
+ stroke: { color: "rgba(0,0,0,0.3)", width: 1.5 },
12286
+ shadow: { color: "rgba(0,0,0,0.7)", blur: 8, offsetX: 0, offsetY: 3 },
12287
+ animation: {
12288
+ in: "fade",
12289
+ out: "fade",
12290
+ inDuration: 0.2,
12291
+ outDuration: 0.2,
12292
+ hold: "full"
12293
+ },
12294
+ anchor: {
12295
+ anchorPoint: "bottom-center",
12296
+ maxWidthPercentage: 90
12297
+ }
12298
+ }
12299
+ ]
12300
+ },
12301
+ {
12302
+ id: "fire-orange",
12303
+ label: "Fire Orange",
12304
+ category: "caption",
12305
+ duration: 4,
12306
+ canvasWidth: 1920,
12307
+ canvasHeight: 1080,
12308
+ description: "Bold warm orange with dark outline \u2014 energetic and attention-grabbing for action content.",
12309
+ layers: [
12310
+ {
12311
+ kind: "text",
12312
+ id: "caption-text",
12313
+ content: "Sample Subtitle Caption",
12314
+ fontFamily: "Outfit Variable",
12315
+ fontSize: 40,
12316
+ fontWeight: 900,
12317
+ color: "#FF6B1A",
12318
+ align: "center",
12319
+ x: 360,
12320
+ y: 890,
12321
+ width: 1200,
12322
+ height: 100,
12323
+ role: "primary",
12324
+ textRole: "caption",
12325
+ stroke: { color: "#1A0800", width: 4 },
12326
+ shadow: { color: "rgba(255,80,0,0.4)", blur: 8, offsetX: 0, offsetY: 0 },
12327
+ animation: {
12328
+ in: "fade",
12329
+ out: "fade",
12330
+ inDuration: 0.2,
12331
+ outDuration: 0.2,
12332
+ hold: "full"
12333
+ },
12334
+ anchor: {
12335
+ anchorPoint: "bottom-center",
12336
+ maxWidthPercentage: 90
12337
+ }
12338
+ }
12339
+ ]
12340
+ },
12341
+ {
12342
+ id: "frosted-glass",
12343
+ label: "Frosted Glass",
12344
+ category: "caption",
12345
+ duration: 4,
12346
+ canvasWidth: 1920,
12347
+ canvasHeight: 1080,
12348
+ description: "Modern frosted glass pill with light text \u2014 clean, premium look for lifestyle and brand content.",
12349
+ layers: [
12350
+ {
12351
+ kind: "text",
12352
+ id: "caption-text",
12353
+ content: "Sample Subtitle Caption",
12354
+ fontFamily: "Inter Variable",
12355
+ fontSize: 32,
12356
+ fontWeight: 600,
12357
+ color: "#FFFFFF",
12358
+ align: "center",
12359
+ x: 360,
12360
+ y: 890,
12361
+ width: 1200,
12362
+ height: 100,
12363
+ role: "primary",
12364
+ textRole: "caption",
12365
+ backgroundColor: "rgba(255,255,255,0.12)",
12366
+ backgroundBorderColor: "rgba(255,255,255,0.3)",
12367
+ backgroundBorderWidth: 1,
12368
+ backgroundRadius: 14,
12369
+ padding: 12,
12370
+ paddingTop: 12,
12371
+ paddingBottom: 12,
12372
+ paddingLeft: 24,
12373
+ paddingRight: 24,
12374
+ stroke: { color: "rgba(255,255,255,0.3)", width: 1 },
12375
+ shadow: { color: "rgba(0,0,0,0.4)", blur: 6, offsetX: 0, offsetY: 2 },
12376
+ animation: {
12377
+ in: "fade",
12378
+ out: "fade",
12379
+ inDuration: 0.2,
12380
+ outDuration: 0.2,
12381
+ hold: "full"
12382
+ },
12383
+ anchor: {
12384
+ anchorPoint: "bottom-center",
12385
+ maxWidthPercentage: 90
12386
+ }
12387
+ }
12388
+ ]
12389
+ },
12390
+ {
12391
+ id: "typewriter-mono",
12392
+ label: "Typewriter Mono",
12393
+ category: "caption",
12394
+ duration: 4,
12395
+ canvasWidth: 1920,
12396
+ canvasHeight: 1080,
12397
+ description: "Monospace typewriter style \u2014 perfect for documentary narration, tech, or interview content.",
12398
+ layers: [
12399
+ {
12400
+ kind: "text",
12401
+ id: "caption-text",
12402
+ content: "Sample Subtitle Caption",
12403
+ fontFamily: "monospace",
12404
+ fontSize: 28,
12405
+ fontWeight: 400,
12406
+ color: "#E8E8D8",
12407
+ align: "left",
12408
+ x: 360,
12409
+ y: 890,
12410
+ width: 1200,
12411
+ height: 100,
12412
+ role: "primary",
12413
+ textRole: "caption",
12414
+ backgroundColor: "rgba(0,0,0,0.85)",
12415
+ backgroundRadius: 4,
12416
+ padding: 10,
12417
+ paddingTop: 10,
12418
+ paddingBottom: 10,
12419
+ paddingLeft: 16,
12420
+ paddingRight: 16,
12421
+ animation: {
12422
+ in: "fade",
12423
+ out: "fade",
12424
+ inDuration: 0.2,
12425
+ outDuration: 0.2,
12426
+ hold: "full"
12427
+ },
12428
+ anchor: {
12429
+ anchorPoint: "bottom-center",
12430
+ maxWidthPercentage: 90
12431
+ }
12432
+ }
12433
+ ]
13529
12434
  }
13530
12435
  ];
13531
12436
  function getCanvasTemplatePreset(id) {
@@ -25584,7 +24489,6 @@ var VERSION = "1.4.0";
25584
24489
  CANONICAL_RENDERER_VERSION,
25585
24490
  CANONICAL_SCHEMA_VERSION,
25586
24491
  COMPOSITION_PRESETS,
25587
- CameraEffects,
25588
24492
  CanvasDevice,
25589
24493
  CommandBufferBuilder,
25590
24494
  CommandExecutor,
@@ -25636,7 +24540,6 @@ var VERSION = "1.4.0";
25636
24540
  LOTTIE_TEMPLATE_PRESETS,
25637
24541
  LayerAnimationSchema,
25638
24542
  LayoutEngine,
25639
- LightEffects,
25640
24543
  LiveBroadcastBridge,
25641
24544
  MediaEncoderRegistry,
25642
24545
  MediaImageEngine,