Skip to content

Commit

Permalink
Fix images exported by GFX editor being in indexed color mode
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Jan 27, 2018
1 parent 623307c commit dee1f90
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dsvedit/gfx_editor_dialog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion dsvlib/darkfunction_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dsvlib/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dsvlib/spriter_interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit dee1f90

Please sign in to comment.