generate color reduced smaller size 8bit PNG using pngquant

pull/18/head
Hartmut Holzgraefe 2017-07-16 19:56:17 +00:00
rodzic a66157f218
commit 101742b08b
2 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -478,6 +478,9 @@ class JobRenderer(threading.Thread):
img.save(prefix + '.jpg', quality=50)
img.thumbnail((200, 200), Image.ANTIALIAS)
img.save(prefix + THUMBNAIL_SUFFIX)
pngquant_cmd = [ "pngquant", "--output", "%s.8bit.png" % prefix,
"%s.png" % prefix ]
subprocess.check_call(pngquant_cmd)
def run(self):
"""Renders the given job, encapsulating all processing errors and

Wyświetl plik

@ -205,6 +205,7 @@ class MapRenderingJob(models.Model):
allfiles = {'maps': {}, 'indeces': {}, 'thumbnail': [], 'errorlog': []}
formats = www.settings.RENDERING_RESULT_FORMATS
formats.append('8bit.png')
formats.append('jpg')
for format in formats:
map_path = self.get_map_filepath(format)