Java:制作低质量图像
在软件“Teamviewer”中,可以更改图像的质量。看起来图像来自 32 位到 16 位(或其他值,如 Windows 中的屏幕设备设置)。图像确实变小了,因为您注意到桌面共享的速度变得更高。我不想要这样的东西:“缩小规模,发送然后扩大规模”。
现在我的问题是:是否可以制作低质量的图像。
谢谢
In the software 'Teamviewer', the quality of the images can be changed. It looks like the image comes from 32bit to 16bit (Or other values, like in the screen device settings in Windows). The image is realy smaller because you notice that the speed of the desktop sharing gets higher. I don't want something like: "scale down, send and than scale up".
Now my question: Is it possible to make a low-quality image.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
有损压缩有四种替代方案:
对于照片等丰富图片,您可能会使用 JPEG 获得最佳增益,并降低位深(甚至降低位深)到使用 8 位或更少的调色板)在其他颜色变化较小的情况下。请注意,如果随后与无损压缩(例如游程编码)相结合,位深度减少是最有效的(您知道甚至 jpeg 也使用它吗?)
You have four alternatives for lossy compression:
And you will probably get the best gain with JPEG for rich pictures like photos, and with bitdepth reduction (even down to using 8bit or less palette) on others with less variation in colors. Please note that bitdepth reduction is most effective if combined with lossless compression afterwards, like runlength encoding (did you know that even jpeg uses that?)
是的,您可以更改许多不同类型图像的压缩设置。
谷歌发现这个: 在 Java 中保存图像时调整 JPEG 图像压缩质量
Yes, you can change the compression settings for many different types of Images.
Google found this: Adjust JPEG image compression quality when saving images in Java
您可以使用图像转换器来实现此目的。当用户上传文件时,它会发送到转换器,转换器会执行其操作(根据定义的设置)。然而,我认为您需要访问权限才能在服务器上运行应用程序。
You can use image converters for this purpose. When user uploads a file its sent to the converter which does its thing (according to defined settings). You would however need access to run applications on the server I think.
ypnos 已经提到了位深度减少。阅读你的问题我也立即想到抖动,当你减少色彩空间的大小。您可以很容易地在网上找到 Floyd-Steinberg 算法的实现。
ypnos already mentioned bit depth reduction. Reading your question I also immediately though of dithering, which will preserve the image better as you reduce the size of the color space. You can pretty easily find implementations of the Floyd-Steinberg algorithm around the net.