Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,13 +4,13 @@ import numpy as np
|
|
4 |
from PIL import Image
|
5 |
import base64
|
6 |
|
7 |
-
color_step = st.slider('color_step', value=10, min_value=1, max_value=179, step=1)
|
8 |
|
9 |
#duration of each frame of the gif in milliseconds
|
10 |
duration_parameter = st.slider('duration_parameter aka duration of each frame of the gif in milliseconds', value=10, min_value=1, max_value=2000, step=10)
|
11 |
|
12 |
#Loop parameter = number of times gif loops. 0 = loops infinitely.
|
13 |
-
loop_parameter = st.slider('Loop parameter aka number of times gif loops', value=0, min_value=0, max_value=10, step=1)
|
14 |
|
15 |
|
16 |
if color_step == 0:
|
@@ -19,7 +19,7 @@ else:
|
|
19 |
my_hue_list = list( range(0, 180, color_step) ) #Color step basically gives step range of this list, ie if color_step = 2 then it is [0,2,4,6,....,178]
|
20 |
|
21 |
|
22 |
-
|
23 |
user_image_object = st.file_uploader("upload your image", type=['png', 'jpg'], accept_multiple_files=False)
|
24 |
|
25 |
if user_image_object is not None:
|
|
|
4 |
from PIL import Image
|
5 |
import base64
|
6 |
|
7 |
+
color_step = st.slider('color_step parameter. Affects the number of colors that will be sampled. Choose 1 to get the max number of colors, anything above 90 to get just 2 colors', value=10, min_value=1, max_value=179, step=1)
|
8 |
|
9 |
#duration of each frame of the gif in milliseconds
|
10 |
duration_parameter = st.slider('duration_parameter aka duration of each frame of the gif in milliseconds', value=10, min_value=1, max_value=2000, step=10)
|
11 |
|
12 |
#Loop parameter = number of times gif loops. 0 = loops infinitely.
|
13 |
+
loop_parameter = st.slider('Loop parameter aka number of times gif loops. 0 defaults to infinitely repeating gif, like most gifs', value=0, min_value=0, max_value=10, step=1)
|
14 |
|
15 |
|
16 |
if color_step == 0:
|
|
|
19 |
my_hue_list = list( range(0, 180, color_step) ) #Color step basically gives step range of this list, ie if color_step = 2 then it is [0,2,4,6,....,178]
|
20 |
|
21 |
|
22 |
+
st.text("Upload an image and this app will turn it into a GIF based on the slider values. Larger images will take longer to process, very large images may not be able to be processed.")
|
23 |
user_image_object = st.file_uploader("upload your image", type=['png', 'jpg'], accept_multiple_files=False)
|
24 |
|
25 |
if user_image_object is not None:
|