top of page

Image Transformation (PE.ImageTransformation)

PE.ImageTransformation.crop(img: pygame.Surface, size: tuple[int, int], pos=(0, 0))

crop a pygame surface (aka image).

function actions:

makes another surface in other size and puts the image on it.

​

parameters:

img - image to crop (pygame.Surface)

size - the new size, the size of the crop (vector2 like)

pos - the offset of the crop (vector2 like)

​

returns:

the cropped image (pygame.Surface)

PE.ImageTransformation.blur(img: pygame.Surface, level: int)

blur a pygame surface (aka image).

function actions:

change the resolution of the image.

​

parameters:

img - image to apply the effect on (pygame.Surface)

level - intensity of the effect (int) 

​

returns:

the new image (pygame.Surface)

PE.ImageTransformation.pixelate(img: pygame.Surface, level: int)

pixelate a pygame surface (aka image).

function actions:

change the resolution of the image.

​

parameters:

img - image to apply the effect on (pygame.Surface)

level - intensity of the effect (int) 

​

returns:

the new image (pygame.Surface)

PE.ImageTransformation.find_edges(img: pygame.Surface)

function actions:

apply laplacian edg-finder algorithm on the image.

​

parameters:

img - image to apply the effect on (pygame.Surface)

​

returns:

the new image (pygame.Surface)

PE.ImageTransformation.scroll(img: pygame.Surface, offset: pygame.Vector2)

let you move the image in its own surface, any pixel that is offscreen returns from the other side. can be used to make repetitive moving background.

​

function actions:

scroll several images in space.

​

parameters:

img - image to apply the effect on (pygame.Surface)

offset - the offset in space of the image (vector2 like)

​

returns:

the new image (pygame.Surface)

PE.ImageTransformation.tint(img: pygame.Surface, color: pygame.color, mode=pygame.BLEND_MULT)

function actions:

tint an image.

​

parameters:

img - image to apply the effect on (pygame.Surface)

color - the color of the tint (color3 like / color4 like)

mode - the pygame blend mode (pygame.BLEND_...)

​

returns:

the tinted image (pygame.Surface)

PE.ImageTransformation.tint_add(img: pygame.Surface, color: pygame.color)

function actions:

tint an image using the pygame.BLEND_ADD mode.

​

parameters:

img - image to apply the effect on (pygame.Surface)

color - the color of the tint (color3 like / color4 like)

​

returns:

the tinted image (pygame.Surface)

PE.ImageTransformation.tint_sub(img: pygame.Surface, color: pygame.color)

function actions:

tint an image using the pygame.BLEND_SUB mode.

​

parameters:

img - image to apply the effect on (pygame.Surface)

color - the color of the tint (color3 like / color4 like)

​

returns:

the tinted image (pygame.Surface)

PE.ImageTransformation.tint_mul(img: pygame.Surface, color: pygame.color)

function actions:

tint an image using the pygame.BLEND_MUL mode.

​

parameters:

img - image to apply the effect on (pygame.Surface)

color - the color of the tint (color3 like / color4 like)

​

returns:

the tinted image (pygame.Surface)

PE.ImageTransformation.tint_lighten(img: pygame.Surface, color: pygame.color)

function actions:

tint an image using the pygame.BLEND_MAX mode.

​

parameters:

img - image to apply the effect on (pygame.Surface)

color - the color of the tint (color3 like / color4 like)

​

returns:

the tinted image (pygame.Surface)

PE.ImageTransformation.tint_darken(img: pygame.Surface, color: pygame.color)

function actions:

tint an image using the pygame.BLEND_MIN mode.

​

parameters:

img - image to apply the effect on (pygame.Surface)

color - the color of the tint (color3 like / color4 like)

​

returns:

the tinted image (pygame.Surface)

Powered and secured by Wix © 2035

bottom of page