- small_image = resize(image, 480, 720)
- small_image_file_name = '%s.small.%d.png' % (base_name, i)
- small_image.save(small_image_file_name, optimize=True, bits=6)
- os.system('pngnq -n 8 -e .png -d output -f "%s"' % small_image_file_name)
- os.remove(small_image_file_name)
+ small_image = resize(image, 640, 960)
+ small_image = small_image.convert('L')
+ small_image = ImageOps.autocontrast(small_image, cutoff=85)
+ # small_image = small_image.filter(ImageFilter.SHARPEN)
+ small_image.save(tmp_output_dir + '/' + image_name)
+
+ os.system('pngnq -n 128 -s 1 -e .png -d "%s" -f "%s"' % (
+ output_dir,
+ tmp_output_dir + '/' + image_name,
+ ))
+ os.remove(tmp_output_dir + '/' + image_name)