changeset 12:580b64af2241

Add support for images that have already had their width cut down in direct color converter. Remove debug print statement.
author Mike Pavone <pavone@retrodev.com>
date Fri, 06 Sep 2013 19:13:46 -0700
parents 19226d79f839
children 30f1d4c90900
files img2dcolor.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/img2dcolor.py	Fri Sep 06 19:09:19 2013 -0700
+++ b/img2dcolor.py	Fri Sep 06 19:13:46 2013 -0700
@@ -18,16 +18,16 @@
 	A = 255
 	x = 0
 	y = 0
+	out_width = width if width <= 198 else width/2
 	for pixel in pixels:
 		if x == width:
 			x = 0
 			y += 1
 		if x == 0:
-			pad = 198-width/2
-			print 'pad', pad
+			pad = 198-out_width
 			for i in xrange(0, pad*2):
 				gpixels.append(0)
-		if not (x & 1):
+		if width == out_width or not (x & 1):
 			(R,G,B) = gcolor(pixel)
 			gpixels.append(B)
 			gpixels.append(G << 4 | R)