mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 13:40:54 +03:00
Use rawmode instead of splitting and merging
This commit is contained in:
parent
bd56a95659
commit
73a383fa72
|
@ -377,9 +377,7 @@ class BLP1Decoder(_BLPBaseDecoder):
|
||||||
args = image.tile[0].args
|
args = image.tile[0].args
|
||||||
assert isinstance(args, tuple)
|
assert isinstance(args, tuple)
|
||||||
image.tile = [image.tile[0]._replace(args=(args[0], "CMYK"))]
|
image.tile = [image.tile[0]._replace(args=(args[0], "CMYK"))]
|
||||||
r, g, b = image.convert("RGB").split()
|
self.set_as_raw(image.convert("RGB").tobytes(), "BGR")
|
||||||
reversed_image = Image.merge("RGB", (b, g, r))
|
|
||||||
self.set_as_raw(reversed_image.tobytes())
|
|
||||||
|
|
||||||
|
|
||||||
class BLP2Decoder(_BLPBaseDecoder):
|
class BLP2Decoder(_BLPBaseDecoder):
|
||||||
|
|
|
@ -1664,6 +1664,7 @@ static struct {
|
||||||
{"RGBA", "RGBaXX", 48, unpackRGBaskip2},
|
{"RGBA", "RGBaXX", 48, unpackRGBaskip2},
|
||||||
{"RGBA", "RGBa;16L", 64, unpackRGBa16L},
|
{"RGBA", "RGBa;16L", 64, unpackRGBa16L},
|
||||||
{"RGBA", "RGBa;16B", 64, unpackRGBa16B},
|
{"RGBA", "RGBa;16B", 64, unpackRGBa16B},
|
||||||
|
{"RGBA", "BGR", 24, ImagingUnpackBGR},
|
||||||
{"RGBA", "BGRa", 32, unpackBGRa},
|
{"RGBA", "BGRa", 32, unpackBGRa},
|
||||||
{"RGBA", "RGBA;I", 32, unpackRGBAI},
|
{"RGBA", "RGBA;I", 32, unpackRGBAI},
|
||||||
{"RGBA", "RGBA;L", 32, unpackRGBAL},
|
{"RGBA", "RGBA;L", 32, unpackRGBAL},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user