Browse Source

Multires: Convert images to RGB when necessary.

Fixes mpetroff/panellum#455
pull/456/head
Mike Noordermeer 7 years ago
parent
commit
bda873679d
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      utils/multires/generate.py

+ 4
- 0
utils/multires/generate.py View File

@@ -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)



Loading…
Cancel
Save