From dee1f90f1d357f0f5b3dc371d86482e1ed916562 Mon Sep 17 00:00:00 2001 From: LagoLunatic Date: Sat, 27 Jan 2018 01:11:33 -0500 Subject: [PATCH] Fix images exported by GFX editor being in indexed color mode --- dsvedit/gfx_editor_dialog.rb | 2 +- dsvlib/darkfunction_interface.rb | 2 +- dsvlib/renderer.rb | 4 ++-- dsvlib/spriter_interface.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dsvedit/gfx_editor_dialog.rb b/dsvedit/gfx_editor_dialog.rb index 9d5d4d71..bc5f15d7 100644 --- a/dsvedit/gfx_editor_dialog.rb +++ b/dsvedit/gfx_editor_dialog.rb @@ -270,7 +270,7 @@ def export_file end file_basename = File.basename(gfx_name, ".*") gfx_file_path = "#{@output_folder}/#{file_basename}_#{palette_name}.png" - chunky_image.save(gfx_file_path) + chunky_image.save(gfx_file_path, :fast_rgba) end palette_file_path = "#{@output_folder}/#{palette_name}.png" diff --git a/dsvlib/darkfunction_interface.rb b/dsvlib/darkfunction_interface.rb index be6669d9..70bf6e64 100644 --- a/dsvlib/darkfunction_interface.rb +++ b/dsvlib/darkfunction_interface.rb @@ -97,7 +97,7 @@ def self.export(output_path, name, sprite_info, fs, renderer, transparent_trails hitbox_red_x_off = 0 hitbox_red_y_off = big_gfx_page.height-hitbox_red_rect.height big_gfx_page.replace!(hitbox_red_rect, hitbox_red_x_off, hitbox_red_y_off) - big_gfx_page.save(output_path + "/#{name}.png") + big_gfx_page.save(output_path + "/#{name}.png", :fast_rgba) unique_parts_by_index = sprite.get_unique_parts_by_index() unique_parts = unique_parts_by_index.values.map{|dup_data| dup_data[:unique_part]}.uniq diff --git a/dsvlib/renderer.rb b/dsvlib/renderer.rb index 26dc3a68..2b36a53c 100644 --- a/dsvlib/renderer.rb +++ b/dsvlib/renderer.rb @@ -59,7 +59,7 @@ def render_room(folder, room, collision = false) filename = "#{folder}/#{room.area_name}/Rendered Rooms/#{room.filename}.png" end FileUtils::mkdir_p(File.dirname(filename)) - rendered_level.save(filename) + rendered_level.save(filename, :fast_rgba) #puts "Wrote #{filename}" end @@ -503,7 +503,7 @@ def generate_palettes(palette_data_start_offset, colors_per_palette) def export_palette_to_palette_swatches_file(palette, file_path) image = convert_palette_to_palette_swatches_image(palette) - image.save(file_path) + image.save(file_path, :fast_rgba) end def convert_palette_to_palette_swatches_image(palette) diff --git a/dsvlib/spriter_interface.rb b/dsvlib/spriter_interface.rb index deb90a31..13b64430 100644 --- a/dsvlib/spriter_interface.rb +++ b/dsvlib/spriter_interface.rb @@ -10,7 +10,7 @@ def self.export(output_path, name, skeleton, sprite_info, fs, renderer) chunky_frames, min_x, min_y = renderer.render_sprite(sprite_info) chunky_frames.each_with_index do |chunky_frame, i| - chunky_frame.save(output_path + "/frame%02X.png" % i) + chunky_frame.save(output_path + "/frame%02X.png" % i, :fast_rgba) end image_width = chunky_frames.first.width @@ -27,7 +27,7 @@ def self.export(output_path, name, skeleton, sprite_info, fs, renderer) # #gfx_page = sprite_info.gfx_pages[0] #chunky_gfx_page = renderer.render_gfx_page(gfx_page.file, palette, gfx_page.canvas_width) - #chunky_gfx_page.save(output_path + "/#{name}.png") + #chunky_gfx_page.save(output_path + "/#{name}.png", :fast_rgba) builder = Nokogiri::XML::Builder.new do |xml| xml.spriter_data(