Pygame颜色不正确 [英] Pygame colours aren't correct

查看:103
本文介绍了Pygame颜色不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Pygame中创建了一个窗口,该窗口在运行之前显示了一个篮球场,并且会显示图像,但是我在图形设计师的帮助下重新制作了背景,但是此新的抛光图像显示为蓝色。为什么是蓝色? 这是需要使用的bballcourt.jpg图片

I have created a window in Pygame which shows a basketball court, before it was functioning and would show the image however I have remade the background with the help of a graphic designer yet this new polished image shows as blue. Why is it blue? Here is the bballcourt.jpg image that needs to be used

以下是用于创建图像背景的代码:

Here is the code used to create the image background:

(width, height) = (940,500)#variables for screen
background_image = pygame.image.load("bballcourt.png")#setting the background image as a variable to be used to display on the screen
screen.blit(background_image, [0,0]) #this sets the background court image 


推荐答案

只需回顾一下我的旧问题-这是提供的@furas答案,但答案格式为非注释:D

一些工具向我展示了此JPG使用CMYK调色板,该调色板用于印刷材料-例如在报纸上。请设计师创建RGB文件。

"some tool shows me that this JPG use CMYK palette which is used for printed materials - ie. in newspapers. Ask designer to create RGB file."

从CMYK自动转换为RGB并不总是很好看,像Photoshop这样的程序有一些颜色配置文件(ICC文件)更好地转换颜色。 JPG会创建较小的文件,但会删除像素,因此每次转换后看起来可能最糟。更好地将图像保留为PNG。

"Automatic converting from CMYK to RGB not always look good. There are some "color profiles" (ICC files) for programs like Photoshop to better convert color. JPG creates small file but it removes pixels so it can look worst after every conversion. Better keep image as PNG."

感谢@furas-希望任何搜索SO的人都可以在未看到评论的情况下得到答复

Thanks @furas - hopefully anyone searching SO sees this has been answered should they not see the comments

这篇关于Pygame颜色不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆