Jeffgold commited on
Commit
f2fbc59
·
verified ·
1 Parent(s): ff33256

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -14,6 +14,7 @@ def preprocess_image(image):
14
  size = max(image.size)
15
  new_image = Image.new("RGBA", (size, size), (255, 255, 255, 0))
16
  new_image.paste(image, ((size - image.width) // 2, (size - image.height) // 2))
 
17
  return new_image
18
 
19
  def create_gif(editor1_output, editor2_output, transition_type):
@@ -124,7 +125,7 @@ with gr.Blocks() as iface:
124
  eraser=gr.Eraser(default_size=10),
125
  height=400,
126
  width=400,
127
- crop_size=(256, 256),
128
  layers=True,
129
  type="pil"
130
  )
@@ -135,7 +136,7 @@ with gr.Blocks() as iface:
135
  eraser=gr.Eraser(default_size=10),
136
  height=400,
137
  width=400,
138
- crop_size=(256, 256),
139
  layers=True,
140
  type="pil"
141
  )
 
14
  size = max(image.size)
15
  new_image = Image.new("RGBA", (size, size), (255, 255, 255, 0))
16
  new_image.paste(image, ((size - image.width) // 2, (size - image.height) // 2))
17
+ new_image = new_image.resize((256, 256), Image.LANCZOS) # Resize to match crop size
18
  return new_image
19
 
20
  def create_gif(editor1_output, editor2_output, transition_type):
 
125
  eraser=gr.Eraser(default_size=10),
126
  height=400,
127
  width=400,
128
+ crop_size=(256, 256), # Specify exact crop size
129
  layers=True,
130
  type="pil"
131
  )
 
136
  eraser=gr.Eraser(default_size=10),
137
  height=400,
138
  width=400,
139
+ crop_size=(256, 256), # Specify exact crop size
140
  layers=True,
141
  type="pil"
142
  )