From 3a5864fb1317c5ecb830aa8c046c2a4e4231fa7d Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Fri, 20 Jan 2012 10:19:51 -0600 Subject: improvements to romviz.py hg-commit-id: 7c93000d5ae5 --- extras/romviz.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'extras/romviz.py') diff --git a/extras/romviz.py b/extras/romviz.py index de8eb596..f3f733db 100644 --- a/extras/romviz.py +++ b/extras/romviz.py @@ -20,19 +20,14 @@ analyze_incbins.process_incbins() width = 1024 height = 1024 -color_table = {} -print "creating color table..." -for value in range(0, 256): - color_table[value] = (value, value, value) +im = Image.new("P", (width, height)) -im = Image.new("RGB", (width, height)) - -print "drawing base color..." -for pos in range(0, len(extract_maps.rom)): - widthx = pos % width - heighty = floor(pos / height) - #im.putpixel((widthx, heighty), color_table[ord(extract_maps.rom[pos])]) - im.putpixel((widthx, heighty), (0, 0, 0)) +#print "drawing base color..." +#for pos in range(0, len(extract_maps.rom)): +# widthx = pos % width +# heighty = floor(pos / height) +# #im.putpixel((widthx, heighty), color_table[ord(extract_maps.rom[pos])]) +# im.putpixel((widthx, heighty), (0, 0, 0)) #print "Searching for incbin... for pos= " + hex(pos) #incbin_found = analyze_incbins.find_incbin_to_replace_for(pos) @@ -50,6 +45,6 @@ for incbin_key in analyze_incbins.processed_incbins: for pos in range(start, end+1): widthx = pos % width heighty = floor(pos / height) - im.putpixel((widthx, heighty), (255, 0, 0)) + im.putpixel((widthx, heighty), 255) im.save("test.png") -- cgit v1.2.3 From 326ae1c1293f80f2cf16ef4ae2ae2c327cf987a6 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Fri, 20 Jan 2012 10:39:54 -0600 Subject: i'm really bad at colors hg-commit-id: 9a74eed9b5b2 --- extras/romviz.py | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'extras/romviz.py') diff --git a/extras/romviz.py b/extras/romviz.py index f3f733db..e071ecfe 100644 --- a/extras/romviz.py +++ b/extras/romviz.py @@ -20,21 +20,11 @@ analyze_incbins.process_incbins() width = 1024 height = 1024 -im = Image.new("P", (width, height)) - -#print "drawing base color..." -#for pos in range(0, len(extract_maps.rom)): -# widthx = pos % width -# heighty = floor(pos / height) -# #im.putpixel((widthx, heighty), color_table[ord(extract_maps.rom[pos])]) -# im.putpixel((widthx, heighty), (0, 0, 0)) - - #print "Searching for incbin... for pos= " + hex(pos) - #incbin_found = analyze_incbins.find_incbin_to_replace_for(pos) - #if incbin_found == None: - # im.putpixel((widthx, heighty), (0, 0, 0)) - #else: - # im.putpixel((widthx, heighty), (255, 255, 255)) +im = Image.new("P", (width, height), 255) + +im.putpalette([ + 0, +]) print "drawing incbins..." for incbin_key in analyze_incbins.processed_incbins: @@ -45,6 +35,6 @@ for incbin_key in analyze_incbins.processed_incbins: for pos in range(start, end+1): widthx = pos % width heighty = floor(pos / height) - im.putpixel((widthx, heighty), 255) + im.putpixel((widthx, heighty), 0) im.save("test.png") -- cgit v1.2.3 From 0bf1f601c4c4adf44160ea5d425afbecec407895 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Fri, 20 Jan 2012 11:01:58 -0600 Subject: fix palette on romviz.py hg-commit-id: 104f640e8a98 --- extras/romviz.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'extras/romviz.py') diff --git a/extras/romviz.py b/extras/romviz.py index e071ecfe..eefdca30 100644 --- a/extras/romviz.py +++ b/extras/romviz.py @@ -20,10 +20,11 @@ analyze_incbins.process_incbins() width = 1024 height = 1024 -im = Image.new("P", (width, height), 255) +im = Image.new("P", (width, height), 0) im.putpalette([ - 0, + 0, 0, 0, + 126, 30, 156, ]) print "drawing incbins..." @@ -35,6 +36,6 @@ for incbin_key in analyze_incbins.processed_incbins: for pos in range(start, end+1): widthx = pos % width heighty = floor(pos / height) - im.putpixel((widthx, heighty), 0) + im.putpixel((widthx, heighty), 1) im.save("test.png") -- cgit v1.2.3