Skip to content

set_color @ pygame.transform.threshold format is BGR instead of RGB if the image does not have an alpha channel. #3702

@Kyuchumimo

Description

@Kyuchumimo

Expected behavior:
RGB format for set_color @ pygame.transform.threshold

Screenshots
test.png:
Image
test2.png:
Image
test3.png:
Image
test4.png:
Image

Test code

import pygame
pygame.init()

image = pygame.image.load('test.png')
pygame.transform.threshold(image, image, (255,0,255), (0,0,0,0), (255,0,0), 1, None, True)
pygame.image.save(image, 'test2.png')

image = pygame.image.load('test.png')
pygame.transform.threshold(image, image, (255,0,255), (0,0,0,0), (0,255,0), 1, None, True)
pygame.image.save(image, 'test3.png')

image = pygame.image.load('test.png')
pygame.transform.threshold(image, image, (255,0,255), (0,0,0,0), (0,0,255), 1, None, True)
pygame.image.save(image, 'test4.png')

pygame.quit()

Metadata

Metadata

Assignees

Labels

bugNot working as intendedtransformpygame.transform

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions