如何缩小 JPEG 图像以使文本尽可能清晰?
我有一些 JPEG 图像,需要将其缩小到原始大小的 80% 左右。原始图像尺寸约为 700px × 1000px。图像包含一些计算机生成的文本,可能还包含一些图形(类似于您在公司 Word 文档中找到的内容)。
如何缩放图像以使文本尽可能清晰?目前,我们正在使用双三次插值缩小 imaeg,但这会使文本变得模糊。
I have some JPEG images that I need scale down to about 80% of original size. Original image dimension are about 700px × 1000px. Images contain some computer generated text and possibly some graphics (similar to what you would find in corporate word documents).
How to scale image so that the text is as legible as possible? Currently we are scaling the imaeg down using bicubic interpolation, but that makes the text blurry and foggy.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
两个选项:
使用不同的重采样算法。 Lanczos 为您提供不太模糊的结果。
您可以使用高级 JPEG 库,将 8x8 块重新采样为 6x6 像素。
Two options:
Use a different resampling algorithm. Lanczos gives you a much less blurrier result.
You ight use an advances JPEG library that resamples the 8x8 blocks to 6x6 pixels.
如果您没有设置为 80%,您可以尝试从 http://www.ijg.org/ 获取并构建 djpeg 因为它可以将您的 jpeg 解压缩到 6/8ths (75%) 或 7/8ths (87.5%) 大小,并且文本质量仍然相当不错:
原版
7/8
3/4
(所以决定内联显示图像时缩放图像)
可能有一种类似工作原理的缩放算法,但这是一个简单的现成解决方案。
If you are not set on exactly 80% you can try getting and building djpeg from http://www.ijg.org/ as it can decompress your jpeg to 6/8ths (75%) or 7/8ths (87.5%) size and the text quality will still be pretty good:
Original
7/8
3/4
(SO decided to scale the images when showing them inline)
There may be a scaling algorithm out there that works similarly, but this is an easy off the shelf solution.
缩小规模总是会带来损失,但这又取决于你的权衡。
There is always a loss involved in scaling down, but it again depends of your trade offs.