浏览代码

Multires: Convert images to RGB when necessary.

Fixes mpetroff/panellum#455
pull/456/head
Mike Noordermeer 7 年前
父节点
当前提交
bda873679d
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      utils/multires/generate.py

+ 4
- 0
utils/multires/generate.py 查看文件

@@ -107,6 +107,8 @@ print('Generating tiles...')
for f in range(0, 6):
size = cubeSize
face = Image.open(os.path.join(args.output, faces[f]))
if face.mode != 'RGB':
face = face.convert('RGB')
for level in range(levels, 0, -1):
if not os.path.exists(os.path.join(args.output, str(level))):
os.makedirs(os.path.join(args.output, str(level)))
@@ -130,6 +132,8 @@ for f in range(0, 6):
if not os.path.exists(os.path.join(args.output, 'fallback')):
os.makedirs(os.path.join(args.output, 'fallback'))
face = Image.open(os.path.join(args.output, faces[f]))
if face.mode != 'RGB':
face = face.convert('RGB')
face = face.resize([1024, 1024], Image.ANTIALIAS)
face.save(os.path.join(args.output, 'fallback', faceLetters[f] + extension), quality = args.quality)



正在加载...
取消
保存