add another low bitdepth png save test

This commit is contained in:
John Cupitt 2022-08-14 11:05:09 +01:00
parent ca2796aa7f
commit 94d3f93a46
1 changed files with 6 additions and 0 deletions

View File

@ -410,6 +410,12 @@ class TestForeign:
len_mono1 = len(self.mono.write_to_buffer(".png", bitdepth=1))
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
# available and there's no easy test for its presence