[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] BUG: transform.average_surfaces in 24 bit mode from pygame.image.load'd surfaces.
- To: pygame-users@xxxxxxxx
- Subject: [pygame] BUG: transform.average_surfaces in 24 bit mode from pygame.image.load'd surfaces.
- From: "René Dudfield" <renesd@xxxxxxxxx>
- Date: Thu, 4 Sep 2008 16:15:15 +1000
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 04 Sep 2008 02:15:21 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=Mb1L/76UTQ7qA5FRZrtneT2dFZazxSM1I9ynzFhi0xg=; b=MjPTSyRQF7Bl+dJFeGlai2bGsQEnl//Y2SRqEyxdCXvyP/gS1Bmkxyz2e7Kp056hfA 6Wqs5Tj5I+i9TAp85uIx7i0gXmQknkIDl5Js3lN/8TQnKUfqIVyRiDTPPPcrz99BZqla PvvEA2FY2VYjfOmt6ZgQaNQPVGR2Vtet7PltQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=SoKP2UNjIOua+qQ0pCa5Zhsd8li5vI90hy7hO7PhOYfjNhgX7io4yiQ3IWRtOR4Pwt Hyufhse0lC74upHd2KLfR4hiPvyKZorLCobkeKaCoAUBeUgHD4ADNl1zL2j+lEUOAnDz 4g8XkWq65BAZ80rsf27sKjv2+SqeHfGfxibjk=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
hi,
in 24 bit mode the average surfaces seems to swap the blue and the red
channels around.
This happens when loading some jpg files to average them.
Had a quick look... but I can't reproduce it in the test runner.
24bit loaded images have these get_masks()...
(255, 65280, 16711680, 0)
32bit images after surf.convert() have these get_masks()
(16711680, 65280, 255, 0)
However!
when I create a surface like...
depth = 24
surf = pygame.Surface((90, 90), 0, depth)
>>> surf.get_masks()
(16711680, 65280, 255, 0)
The same mask as the surf.convert() but *not* the same as the
pygame.image.load("file.jpg") surface.
So maybe the image loading function is putting the incorrect masks on
the loaded images... except the loaded images seem to blit ok.
So I'm a bit confused.
The test is here (it doesn't fail):
test/transform_test.py
def test_average_surfaces__24(self):