Home > front end >  Upscale an image in pygame without losing quality
Upscale an image in pygame without losing quality

Time:10-10

I have an image in svg format of height and width 45 i want to upscale it to 75 is it possible to do without losing quality in pygame.

The image before resizing:

enter image description here

The image after resizing:

enter image description here

The code I used to resize:

pygame.transform.scale(pygame.image.load('bP.svg'),(75,75))

CodePudding user response:

this should help with upscaling as it uses a bilinear filter:

pygame.transform.smoothscale(pygame.image.load('bP.svg'),(75,75))

CodePudding user response:

The format of the Scalable Vector Graphics is a text format. You can edit the SVG file and add a global scale (see SVG/Transformationen). e.g.:

<svg
    transform="scale(2)"
    ...
>
  • Related