Skip to content

Commit d246f0c

Browse files
author
hanati
committed
make generated image look batter, jpg->png
1 parent 2f2b093 commit d246f0c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/layout/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def dump(self):
347347

348348
name = hashlib.sha1(self.bg_img.tobytes()).hexdigest()
349349

350-
pic_name = "pic_" + name + ".jpg"
350+
pic_name = "pic_" + name + ".png"
351351
pic_path = os.path.join(pic_dir, pic_name)
352352
with open(pic_path, 'wb') as f:
353353
self.bg_img.save(f)
@@ -358,7 +358,7 @@ def dump(self):
358358

359359
for index, fragment in enumerate(self.collect_block_fragment()):
360360
fragment_img = fragment['img']
361-
fragment_img_name = "fragment_" + name + str(index) + ".jpg"
361+
fragment_img_name = "fragment_" + name + str(index) + ".png"
362362
fragment_img_path = os.path.join(fragment_dir, fragment_img_name)
363363
with open(fragment_img_path, 'wb') as f:
364364
fragment_img.save(f)

service/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def gen_voc(layout_data):
134134
log.info("voc data gen success")
135135

136136

137-
def _gen_voc(save_dir, data, image_format='jpg'):
137+
def _gen_voc(save_dir, data, image_format='png'):
138138
w = data['width']
139139
h = data['height']
140140

0 commit comments

Comments
 (0)