像素格式 [英] Pixel Format

查看:126
本文介绍了像素格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我有一个问题.我有一个需要截图的程序,但我需要的文件很小,所以我一直在调整Pixel格式.我一直在使用16位RGB565,而我只是想知道使用RGB555质量或明智地使用文件大小是否有任何优势?由于1位未使用,某些压缩算法会利用这一点吗?还是两个文件的压缩后或压缩后的文件大小都相同(压缩后还是压缩后),但质量稍高一点?

我已经尝试使用Google搜索,但对于某些像素格式似乎没有太多答案...

Hey guys, I have a question. I''m having a program that takes screenshots but I need a small file size, so I''ve been adjusting the Pixel format. I''ve been using 16 bit RGB565 and I''m just wondering if there is any advantage using RGB555 quality or file size wise? Since 1 bit is un-used, would certain compression algorithms take advantage of that? Or would both files end up the same size (after or before compression) only the RGB565 with a slight higher quality?

I''ve tried googling it but it seems like there isn''t much answers about the certain pixel formats...

Thanks!

推荐答案

取决于屏幕快照中的内容,使用基于调色板的压缩方案可能会获得更好的压缩效果.像GIF这样的格式可以做到这一点.例如,如果屏幕上少于256种不同的颜色(或者您可以强制发生这种情况),则可以在压缩之前将一个像素容纳在一个字节中.我不知道有什么临时代码可以执行此操作,但是我确定它在那里.
Depending on what''s in your screenshots, you might get better compression by using a palette-based compression scheme. Formats like GIF can do that. For example, if there are fewer than 256 different colours on the screen (or you can force that to happen), then you can fit a pixel in one byte before compression. I don''t know offhand of any code to do it, but I''m sure it''s out there.


尝试另存为jpeg,通常大小很小.否则,请像Peter所说的那样,将其另存为GIF.您可能需要创建一个256色的图像并将其绘制到该图像上,以进行色彩还原.不要使用任何奇怪的格式,例如RGB555,没有标准的文件格式使用这些格式.
Try saving as a jpeg, that usually gives a small size. Otherwise, just save it as a GIF, as Peter said. You may need to create a 256 color image and draw your image onto it, in order to do the color reduction. Don''t use any weird formats like RGB555, no standard file format uses those.


这篇关于像素格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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