Skip to content

search_color @ pygame.transform.threshold ignores alpha channelย #3674

@Kyuchumimo

Description

@Kyuchumimo

Current behavior:

search_color @ pygame.transform.threshold ignores alpha channel

Expected behavior:

I was expecting half image turn blue.

Screenshots

128x128 red image with one half 92 transparency and the other half 128 transparency:
Image

after applying pygame.transform.threshold both regions turn blue with 128 transparency:

Image

Test code

import pygame
pygame.init()

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

pygame.quit()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intendeddocstransformpygame.transform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions