我在原始分辨率为1280x720的显示器上以全屏显示一系列图像。需要显示的图像是1280x720像素,以确保它们不需要转换。该图像是jpg高品质。PyGame在图像加载时降低图像质量
当我将图像闪烁到表面时,它会以正确的大小显示图像,填满屏幕。这正如我预料的那样。
但是,显示的图像似乎被压缩。压缩看起来像大约80/100的jpeg压缩。这似乎很好,但是这会导致显示屏上清晰显示的问题区域。下面的代码是我现在拥有的。 Pygame的文件并没有真正表现出任何质量设置,所以我希望我没有移动到另一种方式来做到这一点,尽管这将是罚款......
pygame.display.set_mode((1280, 720))
# move mouse pointer off of the screen
pygame.mouse.set_pos((1280, 720))
pygame.display.update()
# Get the image from disk (with or without convert() shows same result)
picture = pygame.image.load(image).convert()
# smoothscale suggested on stack overflow, but shows no difference.
picture = pygame.transform.smoothscale(picture, (1280, 720))
# Get the screen surface to display an image on and blit
main_surface = pygame.display.get_surface()
main_surface.blit(picture, (0, 0))
pygame.display.update()
正如你所说,图像已经是1280x720。如果删除刻度线会发生什么情况? 问题是,你看到比原始图像质量更低的pygame中的图像,不是吗? – pmoleri
就像你可以在上面的评论中看到的那样,建议使用smoothscale,但没有区别或没有区别。 convert()也一样。 – Ruudt
什么'bpp'是在?每像素 – ninMonkey