Skip to content

Commit d05ff50

Browse files
authored
Merge pull request #7481 from radarhere/gray
2 parents a10dec0 + 19aeed0 commit d05ff50

34 files changed

+80
-80
lines changed

CHANGES.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,7 @@ Changelog (Pillow)
21912191
- Cache EXIF information #3498
21922192
[Glandos]
21932193

2194-
- Added transparency for all PNG greyscale modes #3744
2194+
- Added transparency for all PNG grayscale modes #3744
21952195
[radarhere]
21962196

21972197
- Fix deprecation warnings in Python 3.8 #3749
@@ -4693,7 +4693,7 @@ Changelog (Pillow)
46934693
- Fix Bicubic interpolation #970
46944694
[homm]
46954695

4696-
- Support for 4-bit greyscale TIFF images #980
4696+
- Support for 4-bit grayscale TIFF images #980
46974697
[hugovk]
46984698

46994699
- Updated manifest #957
@@ -6768,7 +6768,7 @@ The test suite includes 750 individual tests.
67686768

67696769
- You can now convert directly between all modes supported by
67706770
PIL. When converting colour images to "P", PIL defaults to
6771-
a "web" palette and dithering. When converting greyscale
6771+
a "web" palette and dithering. When converting grayscale
67726772
images to "1", PIL uses a thresholding and dithering.
67736773

67746774
- Added a "dither" option to "convert". By default, "convert"
@@ -6846,13 +6846,13 @@ The test suite includes 530 individual tests.
68466846
- Fixed "paste" to allow a mask also for mode "F" images.
68476847

68486848
- The BMP driver now saves mode "1" images. When loading images, the mode
6849-
is set to "L" for 8-bit files with greyscale palettes, and to "P" for
6849+
is set to "L" for 8-bit files with grayscale palettes, and to "P" for
68506850
other 8-bit files.
68516851

68526852
- The IM driver now reads and saves "1" images (file modes "0 1" or "L 1").
68536853

68546854
- The JPEG and GIF drivers now saves "1" images. For JPEG, the image
6855-
is saved as 8-bit greyscale (it will load as mode "L"). For GIF, the
6855+
is saved as 8-bit grayscale (it will load as mode "L"). For GIF, the
68566856
image will be loaded as a "P" image.
68576857

68586858
- Fixed a potential buffer overrun in the GIF encoder.
@@ -7156,7 +7156,7 @@ The test suite includes 400 individual tests.
71567156
drawing capabilities can be used to render vector and metafile
71577157
formats.
71587158

7159-
- Added restricted drivers for images from Image Tools (greyscale
7159+
- Added restricted drivers for images from Image Tools (grayscale
71607160
only) and LabEye/IFUNC (common interchange modes only).
71617161

71627162
- Some minor improvements to the sample scripts provided in the
File renamed without changes.
File renamed without changes.

Tests/test_file_apng.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ def test_apng_mode():
231231
assert im.getpixel((0, 0)) == (0, 0, 128, 191)
232232
assert im.getpixel((64, 32)) == (0, 0, 128, 191)
233233

234-
with Image.open("Tests/images/apng/mode_greyscale.png") as im:
234+
with Image.open("Tests/images/apng/mode_grayscale.png") as im:
235235
assert im.mode == "L"
236236
im.seek(im.n_frames - 1)
237237
assert im.getpixel((0, 0)) == 128
238238
assert im.getpixel((64, 32)) == 255
239239

240-
with Image.open("Tests/images/apng/mode_greyscale_alpha.png") as im:
240+
with Image.open("Tests/images/apng/mode_grayscale_alpha.png") as im:
241241
assert im.mode == "LA"
242242
im.seek(im.n_frames - 1)
243243
assert im.getpixel((0, 0)) == (128, 191)

Tests/test_file_bmp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def test_rle8():
159159
with Image.open("Tests/images/hopper_rle8.bmp") as im:
160160
assert_image_similar_tofile(im.convert("RGB"), "Tests/images/hopper.bmp", 12)
161161

162-
with Image.open("Tests/images/hopper_rle8_greyscale.bmp") as im:
162+
with Image.open("Tests/images/hopper_rle8_grayscale.bmp") as im:
163163
assert_image_equal_tofile(im, "Tests/images/bw_gradient.png")
164164

165165
# This test image has been manually hexedited

Tests/test_file_gif.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def test_save_dispose(tmp_path):
590590
def test_dispose2_palette(tmp_path):
591591
out = str(tmp_path / "temp.gif")
592592

593-
# Four colors: white, grey, black, red
593+
# Four colors: white, gray, black, red
594594
circles = [(255, 255, 255), (153, 153, 153), (0, 0, 0), (255, 0, 0)]
595595

596596
im_list = []

Tests/test_file_png.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def test_save_p_transparent_black(self, tmp_path):
297297
assert_image(im, "RGBA", (10, 10))
298298
assert im.getcolors() == [(100, (0, 0, 0, 0))]
299299

300-
def test_save_greyscale_transparency(self, tmp_path):
300+
def test_save_grayscale_transparency(self, tmp_path):
301301
for mode, num_transparent in {"1": 1994, "L": 559, "I": 559}.items():
302302
in_file = "Tests/images/" + mode.lower() + "_trns.png"
303303
with Image.open(in_file) as im:

Tests/test_imagechops.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
ORANGE = (255, 128, 0)
1111
WHITE = (255, 255, 255)
1212

13-
GREY = 128
13+
GRAY = 128
1414

1515

1616
def test_sanity():
@@ -121,12 +121,12 @@ def test_constant():
121121
im = Image.new("RGB", (20, 10))
122122

123123
# Act
124-
new = ImageChops.constant(im, GREY)
124+
new = ImageChops.constant(im, GRAY)
125125

126126
# Assert
127127
assert new.size == im.size
128-
assert new.getpixel((0, 0)) == GREY
129-
assert new.getpixel((19, 9)) == GREY
128+
assert new.getpixel((0, 0)) == GRAY
129+
assert new.getpixel((19, 9)) == GRAY
130130

131131

132132
def test_darker_image():

Tests/test_imagefont.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ def test_multiline_spacing(font):
303303
"orientation", (Image.Transpose.ROTATE_90, Image.Transpose.ROTATE_270)
304304
)
305305
def test_rotated_transposed_font(font, orientation):
306-
img_grey = Image.new("L", (100, 100))
307-
draw = ImageDraw.Draw(img_grey)
306+
img_gray = Image.new("L", (100, 100))
307+
draw = ImageDraw.Draw(img_gray)
308308
word = "testing"
309309

310310
transposed_font = ImageFont.TransposedFont(font, orientation=orientation)
@@ -344,8 +344,8 @@ def test_rotated_transposed_font(font, orientation):
344344
),
345345
)
346346
def test_unrotated_transposed_font(font, orientation):
347-
img_grey = Image.new("L", (100, 100))
348-
draw = ImageDraw.Draw(img_grey)
347+
img_gray = Image.new("L", (100, 100))
348+
draw = ImageDraw.Draw(img_gray)
349349
word = "testing"
350350

351351
transposed_font = ImageFont.TransposedFont(font, orientation=orientation)

0 commit comments

Comments
 (0)