diff --git a/Tests/images/hopper_4bit.bmp b/Tests/images/hopper_4bit.bmp new file mode 100644 index 000000000..8a69b349d Binary files /dev/null and b/Tests/images/hopper_4bit.bmp differ diff --git a/Tests/images/hopper_rle4.bmp b/Tests/images/hopper_rle4.bmp new file mode 100644 index 000000000..3c53cc1dd Binary files /dev/null and b/Tests/images/hopper_rle4.bmp differ diff --git a/Tests/test_file_bmp.py b/Tests/test_file_bmp.py index f6860a9a4..ec852c905 100644 --- a/Tests/test_file_bmp.py +++ b/Tests/test_file_bmp.py @@ -175,6 +175,13 @@ def test_rle8(): with pytest.raises(ValueError): im.load() +def test_rle4(): + with Image.open("Tests/images/hopper_rle4.bmp") as im: + assert_image_similar_tofile(im, "Tests/images/hopper_4bit.bmp", 12) + + with Image.open("Tests/images/bmp/g/pal4rle.bmp") as im: + assert_image_similar_tofile(im, "Tests/images/bmp/g/pal4.bmp", 12) + @pytest.mark.parametrize( "file_name,length",