Skip to content

Commit 2fb2e04

Browse files
authored
Convert some data/example images to webp (#3362)
* Convert some images to webp * Revert some aliens.py things
1 parent 57c3222 commit 2fb2e04

34 files changed

+25
-25
lines changed

docs/reST/tutorials/en/chimp-explanation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ is colliding with the given target sprite. ::
214214

215215
def __init__(self):
216216
pygame.sprite.Sprite.__init__(self) # call Sprite initializer
217-
self.image, self.rect = load_image("chimp.png", -1, 4)
217+
self.image, self.rect = load_image("chimp.webp", -1, 4)
218218
screen = pygame.display.get_surface()
219219
self.area = screen.get_rect()
220220
self.rect.topleft = 10, 90

docs/reST/tutorials/en/move-it.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ and reference. The pygame.image module has a load() function which will do
339339
what we want. The lines to load the images should become this. ::
340340

341341
>>> player = pygame.image.load('player.bmp').convert()
342-
>>> background = pygame.image.load('liquid.bmp').convert()
342+
>>> background = pygame.image.load('liquid.webp').convert()
343343

344344

345345
We can see that's pretty simple, the load function just takes a filename

docs/reST/tutorials/es/ChimpanceLineaporLinea.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ las revisaremos de a una. ::
187187

188188
def __init__(self):
189189
pg.sprite.Sprite.__init__(self) # call Sprite initializer
190-
self.image, self.rect = load_image("fist.png", -1)
190+
self.image, self.rect = load_image("fist.webp", -1)
191191
self.fist_offset = (-235, -80)
192192
self.punching = False
193193

@@ -239,7 +239,7 @@ el puño está chocando con el sprite objetivo. ::
239239

240240
def __init__(self):
241241
pg.sprite.Sprite.__init__(self) # call Sprite intializer
242-
self.image, self.rect = load_image("chimp.png", -1, 4)
242+
self.image, self.rect = load_image("chimp.webp", -1, 4)
243243
screen = pg.display.get_surface()
244244
self.area = screen.get_rect()
245245
self.rect.topleft = 10, 90

examples/arraydemo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def main():
6464
surfdemo_show(striped, "striped")
6565

6666
# rgbarray
67-
imagename = os.path.join(main_dir, "data", "arraydemo.bmp")
67+
imagename = os.path.join(main_dir, "data", "arraydemo.webp")
6868
imgsurface = pygame.image.load(imagename)
6969
rgbarray = surfarray.array3d(imgsurface)
7070
surfdemo_show(rgbarray, "rgbarray")

examples/blend_fill.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def main():
3737
screen = pygame.display.set_mode((640, 480))
3838
screen.fill((100, 100, 100))
3939

40-
image = pygame.image.load(os.path.join(data_dir, "liquid.bmp")).convert()
41-
blendimage = pygame.image.load(os.path.join(data_dir, "liquid.bmp")).convert()
40+
image = pygame.image.load(os.path.join(data_dir, "liquid.webp")).convert()
41+
blendimage = pygame.image.load(os.path.join(data_dir, "liquid.webp")).convert()
4242
screen.blit(image, (10, 10))
4343
screen.blit(blendimage, (200, 10))
4444

examples/blit_blends.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def main():
5252

5353
images = {}
5454
images[pygame.K_1] = im2
55-
images[pygame.K_2] = pygame.image.load(os.path.join(data_dir, "chimp.png"))
55+
images[pygame.K_2] = pygame.image.load(os.path.join(data_dir, "chimp.webp"))
5656
images[pygame.K_3] = pygame.image.load(os.path.join(data_dir, "alien3.gif"))
57-
images[pygame.K_4] = pygame.image.load(os.path.join(data_dir, "liquid.bmp"))
57+
images[pygame.K_4] = pygame.image.load(os.path.join(data_dir, "liquid.webp"))
5858
img_to_blit = im2.convert()
5959
iaa = img_to_blit.convert_alpha()
6060

examples/chimp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Fist(pygame.sprite.Sprite):
5555

5656
def __init__(self):
5757
pygame.sprite.Sprite.__init__(self) # call Sprite initializer
58-
self.image, self.rect = load_image("fist.png", -1)
58+
self.image, self.rect = load_image("fist.webp", -1)
5959
self.fist_offset = (-235, -80)
6060
self.punching = False
6161

@@ -85,7 +85,7 @@ class Chimp(pygame.sprite.Sprite):
8585

8686
def __init__(self):
8787
pygame.sprite.Sprite.__init__(self) # call Sprite initializer
88-
self.image, self.rect = load_image("chimp.png", -1, 4)
88+
self.image, self.rect = load_image("chimp.webp", -1, 4)
8989
screen = pygame.display.get_surface()
9090
self.area = screen.get_rect()
9191
self.rect.topleft = 10, 90

examples/cursors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# Create a color cursor with an image surface
3030

3131
main_dir = os.path.split(os.path.abspath(__file__))[0]
32-
image_name = os.path.join(main_dir, "data", "cursor.png")
32+
image_name = os.path.join(main_dir, "data", "cursor.webp")
3333
image = pygame.image.load(image_name)
3434
image_cursor = pygame.cursors.Cursor(
3535
(image.get_width() // 2, image.get_height() // 2), image

examples/data/arraydemo.bmp

-75.1 KB
Binary file not shown.

examples/data/arraydemo.webp

38.3 KB
Loading

0 commit comments

Comments
 (0)