[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] BUG: Color order reversed on Windows
- To: pygame-users@xxxxxxxx
- Subject: [pygame] BUG: Color order reversed on Windows
- From: Ben Withbroe <ben.says.blah@xxxxxxxxx>
- Date: Fri, 16 May 2014 12:30:08 -0500
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 16 May 2014 13:30:16 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=6UPfV36iLapQBDSjXi69oqpIP855gCN9CGiiNTvptwI=; b=nE7Q//u8Mg30PjRcJMmjCWRfmOblmlm3VpqAQMk1mOb/kROzAQV5B7kMZbOkJ5c+XL amPc0nZA6PO9c25ZzOaox4VWlRZVTwKnefGq4p/JfCzhl9fnb8o+XCT224Vur01elaYY zmtXE+T5975fa3sUz7MZk8nz/79CKQnTO5ZkQDLEtFQh/fIp9M2I2W05cmmNOFlzF6wP KFusz8Xkxr8renvHucSnujkKSKloiHA+p0KlBgYhhyq4cy/lH9x2rnRRd5p+oltKlL9P b1SWKDuaoojloLS3zbxZ0OjaIH01U0DyQiKB4Te4BMe5fquwBpAXurF+d0JuuL6n2Cm0 +1ng==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi pygame devs-
I'm running Pygame 1.9.1release on top of SDL 1.2.13 on Windows 8.1. ÂWhen I set a pixel on a Surface object (with set_at()), and then read the modified pixel back out (with get_at()), the red and blue channels have been exchanged. ÂA minimal demonstration script is attached.
For what it's worth, displaying Surfaces works correctly: if I load an image file to a Surface and then display it, it looks correct. ÂHowever, if I modify the surface (using Surface.set_at()), the modified pixels also display with their red and blue channels exchanged.
Thanks,
import pygame
pygame.init()
print "Pygame version", pygame.version.ver
print "SDL version", pygame.get_sdl_version()
filename = 'background2.jpg'
surface = pygame.image.load(filename)
r = 35
g = 120
b = 180
surface.set_at((400, 15), pygame.Color(r, g, b))
result = surface.get_at((400, 15))
print "Intended color:", r, g, b
print "Instead got: ", result.r, result.g, result.b
Attachment:
background2.jpg
Description: JPEG image