Skip to content

Commit ac029a0

Browse files
committed
Improve compatiblity
1 parent d903c64 commit ac029a0

5 files changed

Lines changed: 11 additions & 4 deletions

File tree

rct-graphics-helper/magick_command.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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):

rct-graphics-helper/models/palette.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ def generate_output(self, renderer, output_path):
230230

231231
cmd.as_montage(color_paths)
232232

233+
print(cmd.get_command_string(
234+
renderer.magick_path, output_path))
233235
subprocess.check_output(cmd.get_command_string(
234236
renderer.magick_path, output_path), shell=True)
235237

rct-graphics-helper/processors/render_task_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(self, context, palette_manager):
4848
]
4949

5050
self.prioritize_final_output = True
51-
self.cleanup_afterwards = True
51+
self.cleanup_afterwards = False
5252

5353
def process(self, task, callback):
5454
def finalize():
251 Bytes
Loading
251 Bytes
Loading

0 commit comments

Comments
 (0)