-
Notifications
You must be signed in to change notification settings - Fork 0
(Emboss, Palette change, Horizontal gradient 1D & 2D)
Yoann Berenguer edited this page May 21, 2023
·
10 revisions
emboss(object surface_, unsigned int flag=0)
"""
EMBOSS A PYGAME SURFACE
:param surface_: pygame.Surface; compatible 24-32 bit
:param flag : integer; special pygame flag such as BLEND_RGB_ADD, BLEND_RGB_MULT etc
:return : pygame.Surface; Emboss effect
"""
e.g:
surf = emboss(surface)
palette_change(
object surface_,
object palette_)
"""
CHANGE AN IMAGE BY CHANGING THE COLOR PALETTE
LIST_PALETTES contains all the palettes available
in the project.
e.g:
from PygameShader.Palette import LIST_PALETTES
print(LIST_PALETTES.keys())
:param surface_: pygame.Surface;
:param palette_: numpy.ndarray containing all the RGB color values
:return: void
"""
e.g:
List all the available palettes
from PygameShader.Palette import LIST_PALETTES
print(LIST_PALETTES.keys())
palette_change(IMAGE, PICO_8_CUSTOM)
IMAGE | PALETTE |
---|---|
![]() |
ORIGINAL |
![]() |
CPC |
![]() |
APPLE |
![]() |
CGA |
![]() |
COMMODORE 64 |
![]() |
PICO 8 |
![]() |
TO7 |
![]() |
ZX SPECTRUM |
![]() |
ORIGINAL |
![]() |
AAP64 |
![]() |
AAPSLENDOR128 |
![]() |
APOLLO |
![]() |
FAMICUBE |
![]() |
FUNKYFUTURE |
![]() |
IRIDESCENTCRYSTAL |
![]() |
LOSPEC500 |
![]() |
SILVER |
![]() |
TWILIOQUEST76 |
![]() |
VINIK24 |
create_horizontal_gradient_1d(
int value,
tuple start_color=(255, 0, 0),
tuple end_color=(0, 255, 0)
)
"""
CREATE AN ARRAY FILLED WITH A GRADIENT COLOR
:param value : integer; Size of the gradient 1d width
:param start_color: tuple; Tuple containing the starting RGB color
:param end_color : tuple; Tuple containing the RGB values of the final color
:return : numpy.ndarray 2D array shape (w, 3) of type uint8 (unsigned char)
containing all the pixels
"""
horizontal_grad3d(
int width,
int height,
tuple start_color=(255, 0, 0),
tuple end_color=(0, 255, 0)
)
"""
CREATE A GRADIENT FROM TWO COLORS
:param width : integer; width of the new surface in pixels
:param height : integer; height of the new surface in pixels
:param start_color: tuple; Value RGB, Starting color
:param end_color : tuple; value RGB, ending color or final color
:return : Surface; pygame.Surface format 24 bit
size width x height converted for fast blit
"""