mirror of
https://github.com/robmcmullen/asmgen.git
synced 2026-04-20 10:16:32 +00:00
Made color selection in PNGs a little more forgiving
This commit is contained in:
+3
-3
@@ -635,10 +635,10 @@ class HGRBW(HGR):
|
||||
b = pixelData[row][col*3+2]
|
||||
color = self.black
|
||||
|
||||
if r==255 and g==255 and b==255:
|
||||
color = self.white
|
||||
elif r==g and r==b and r!=0 and r!=255: # Any gray is chroma key
|
||||
if abs(r - g) < 16 and abs(g - b) < 16 and r!=0 and r!=255: # Any grayish color is chroma key
|
||||
color = self.key
|
||||
elif r>25 or g>25 or b>25: # pretty much all other colors are white
|
||||
color = self.white
|
||||
else:
|
||||
color = self.black
|
||||
return color
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 239 B |
Reference in New Issue
Block a user