@@ -21,12 +21,13 @@ def write_to_cache(self, id, delete_previous=False, next_file=""):
2121 delete_addition = "+delete "
2222 post = " " + self .__stringify_input (next_file )
2323 self .full_command = "( " + self .full_command + \
24- " -write mpr:" + id + " " + delete_addition + ")" + post
24+ " -write mpr:" + id + \
25+ " " + delete_addition + ")" + post
2526
2627 # Quantizes the image using a palette
2728 def quantize (self , palette , amount ):
2829 self .full_command += " -dither FloydSteinberg -define dither:diffusion-amount=" + str (amount ) + "% -remap " + \
29- self .__stringify_input (palette ) + " -depth 16 "
30+ self .__stringify_input (palette ) + " -colorspace sRGB "
3031
3132 # Trims the image to the smallest possible size and outputs the offset difference
3233 def trim (self ):
@@ -45,7 +46,8 @@ def nullify_channels(self, channels_to_nullify):
4546 def id_mask (self , r , g , b ):
4647 color = "rgb(" + "," .join ([str (r ), str (g ), str (b )]) + ")"
4748 self .full_command += " -fill \" #00000000\" +opaque \" " + \
48- color + "\" -fill \" #ffffffff\" -opaque \" " + color + "\" "
49+ color + "\" -fill \" #ffffffff\" -opaque \" " + \
50+ color + "\" "
4951
5052 # Mixes between the current source, and source B given a mask
5153 def mask_mix (self , sourceB , mask ):
@@ -80,6 +82,9 @@ def copy_alpha(self, alpha_source):
8082 def set_bit_depth (self , depth ):
8183 self .full_command += " -depth " + str (depth )
8284
85+ def output (self , file ):
86+ self .full_command += " -write PNG8:" + file
87+
8388 # Gets the cli command to perform the ImageMagick operation
8489
8590 def get_command_string (self , magick_path , output ):
0 commit comments