def convert_image(options):
print 'loading cache'
options['cache'] = json.load(open('color_cache.json'))
print 'beginning conversion'
im = Image.open( options['filename'] )
o = convert_frame(im, options)
o += ANSI_RESET + '\n\n'
# Save to ANSI file and add SAUCE record
if options['output_file'] is not sys.stdout:
save_frame(o,options)
add_sauce(o,options)
# Output to console (unicode)
else:
print_frame(o,options)
# json.dump(options['cache'], open('color_cache.json','w'))
# MAIN FUNCTION
评论列表
文章目录