add another low bitdepth png save test
This commit is contained in:
parent
ca2796aa7f
commit
94d3f93a46
@ -410,6 +410,12 @@ class TestForeign:
|
|||||||
len_mono1 = len(self.mono.write_to_buffer(".png", bitdepth=1))
|
len_mono1 = len(self.mono.write_to_buffer(".png", bitdepth=1))
|
||||||
assert( len_mono1 < len_mono2 )
|
assert( len_mono1 < len_mono2 )
|
||||||
|
|
||||||
|
# take a 1-bit image to png and back
|
||||||
|
onebit = self.mono > 128
|
||||||
|
data = onebit.write_to_buffer(".png", bitdepth=1)
|
||||||
|
after = pyvips.Image.new_from_buffer(data, "")
|
||||||
|
assert( (onebit - after).abs().max() == 0 )
|
||||||
|
|
||||||
# we can't test palette save since we can't be sure libimagequant is
|
# we can't test palette save since we can't be sure libimagequant is
|
||||||
# available and there's no easy test for its presence
|
# available and there's no easy test for its presence
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user