Skip to content

Commit dee1f90

Browse files
committed
Fix images exported by GFX editor being in indexed color mode
1 parent 623307c commit dee1f90

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

dsvedit/gfx_editor_dialog.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def export_file
270270
end
271271
file_basename = File.basename(gfx_name, ".*")
272272
gfx_file_path = "#{@output_folder}/#{file_basename}_#{palette_name}.png"
273-
chunky_image.save(gfx_file_path)
273+
chunky_image.save(gfx_file_path, :fast_rgba)
274274
end
275275

276276
palette_file_path = "#{@output_folder}/#{palette_name}.png"

dsvlib/darkfunction_interface.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def self.export(output_path, name, sprite_info, fs, renderer, transparent_trails
9797
hitbox_red_x_off = 0
9898
hitbox_red_y_off = big_gfx_page.height-hitbox_red_rect.height
9999
big_gfx_page.replace!(hitbox_red_rect, hitbox_red_x_off, hitbox_red_y_off)
100-
big_gfx_page.save(output_path + "/#{name}.png")
100+
big_gfx_page.save(output_path + "/#{name}.png", :fast_rgba)
101101

102102
unique_parts_by_index = sprite.get_unique_parts_by_index()
103103
unique_parts = unique_parts_by_index.values.map{|dup_data| dup_data[:unique_part]}.uniq

dsvlib/renderer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def render_room(folder, room, collision = false)
5959
filename = "#{folder}/#{room.area_name}/Rendered Rooms/#{room.filename}.png"
6060
end
6161
FileUtils::mkdir_p(File.dirname(filename))
62-
rendered_level.save(filename)
62+
rendered_level.save(filename, :fast_rgba)
6363
#puts "Wrote #{filename}"
6464
end
6565

@@ -503,7 +503,7 @@ def generate_palettes(palette_data_start_offset, colors_per_palette)
503503

504504
def export_palette_to_palette_swatches_file(palette, file_path)
505505
image = convert_palette_to_palette_swatches_image(palette)
506-
image.save(file_path)
506+
image.save(file_path, :fast_rgba)
507507
end
508508

509509
def convert_palette_to_palette_swatches_image(palette)

dsvlib/spriter_interface.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def self.export(output_path, name, skeleton, sprite_info, fs, renderer)
1010

1111
chunky_frames, min_x, min_y = renderer.render_sprite(sprite_info)
1212
chunky_frames.each_with_index do |chunky_frame, i|
13-
chunky_frame.save(output_path + "/frame%02X.png" % i)
13+
chunky_frame.save(output_path + "/frame%02X.png" % i, :fast_rgba)
1414
end
1515

1616
image_width = chunky_frames.first.width
@@ -27,7 +27,7 @@ def self.export(output_path, name, skeleton, sprite_info, fs, renderer)
2727
#
2828
#gfx_page = sprite_info.gfx_pages[0]
2929
#chunky_gfx_page = renderer.render_gfx_page(gfx_page.file, palette, gfx_page.canvas_width)
30-
#chunky_gfx_page.save(output_path + "/#{name}.png")
30+
#chunky_gfx_page.save(output_path + "/#{name}.png", :fast_rgba)
3131

3232
builder = Nokogiri::XML::Builder.new do |xml|
3333
xml.spriter_data(

0 commit comments

Comments
 (0)