Update app.py
Browse files
app.py
CHANGED
@@ -105,7 +105,12 @@ def aplicar_glitch(video_clip):
|
|
105 |
def glitch_effect(frame):
|
106 |
import numpy as np
|
107 |
# Desplazar aleatoriamente filas de píxeles
|
|
|
108 |
offset = np.random.randint(-10, 10)
|
|
|
|
|
|
|
|
|
109 |
frame[offset:, :] = frame[:-offset, :]
|
110 |
return frame
|
111 |
|
|
|
105 |
def glitch_effect(frame):
|
106 |
import numpy as np
|
107 |
# Desplazar aleatoriamente filas de píxeles
|
108 |
+
height, width, _ = frame.shape
|
109 |
offset = np.random.randint(-10, 10)
|
110 |
+
if offset > 0:
|
111 |
+
offset = min(offset, height)
|
112 |
+
if offset < 0:
|
113 |
+
offset = max(offset, -height + 1)
|
114 |
frame[offset:, :] = frame[:-offset, :]
|
115 |
return frame
|
116 |
|