mirror of
https://mikeslab.dix.asia/gogs/My-Mods/ANI2Cape.git
synced 2025-10-01 23:14:57 +00:00
Handle palettes with intermittent zeroes
This commit is contained in:
parent
4fa6174d1c
commit
32270a18f3
3 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ def readCUR(f, width=-1.0, height=-1.0):
|
|||
palette = list(frameImage.palette.getdata()[1])
|
||||
for i in range(4, len(palette), 4):
|
||||
if sum(palette[i:i + 3]) == 0:
|
||||
break
|
||||
continue
|
||||
palette[i + 3] = 255
|
||||
frameImage.putpalette(palette, 'BGRA')
|
||||
frameImage = frameImage.convert('RGBA')
|
||||
|
|
|
@ -55,7 +55,7 @@ def CURPaletteFix(image):
|
|||
palette = list(image.palette.getdata()[1])
|
||||
for i in range(4, len(palette), 4):
|
||||
if sum(palette[i:i + 3]) == 0:
|
||||
break
|
||||
continue
|
||||
palette[i + 3] = 255
|
||||
image.putpalette(palette, 'BGRA')
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ def CURPaletteFix(image):
|
|||
palette = list(image.palette.getdata()[1])
|
||||
for i in range(4, len(palette), 4):
|
||||
if sum(palette[i:i + 3]) == 0:
|
||||
break
|
||||
continue
|
||||
palette[i + 3] = 255
|
||||
image.putpalette(palette, 'BGRA')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue