kopia lustrzana https://github.com/hholzgra/maposmatic/
generate color reduced smaller size 8bit PNG using pngquant
rodzic
a66157f218
commit
101742b08b
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue