JPG 解压缩期间缩小 JPG 尺寸

发布于 2024-12-23 07:15:03 字数 359 浏览 1 评论 0原文

我必须缩小并解压缩一组尺寸为 4608 x 3456 的 JPG 图像。目前,我已经能够将图像正确解压缩为 RGB 格式并将其转换为位图。

现在我需要实现缩小,从我到目前为止所读到的内容来看,要正确缩小图像,应该使用双线性插值。然后我应该用插值结果像素替换用于插值的像素 (2x2)。我需要大约当前大小的 1/4。

我不太担心缩小图像的质量,而是担心它的完成速度。整个过程应该尽可能快。

我的问题是,什么时候我应该在 JPG 的解压缩阶段进行双线性插值。我应该在 IDCT(逆离散余弦变换)之后进行插值,还是应该在 IDCT 之前进行插值?

使用 DCT 系数并对它们进行插值,然后在 IDCT 中使用这些结果值是否明智?

I have to downscale and decompress a set of JPG images of size 4608 x 3456. Currently, I have already been able to decompress the images correctly to RGB format and convert them to a Bitmap.

Now I need to implement the downscale, and from what I've read so far to downscale an image correctly one should use Bilinear Interpolation. Then I should replace the pixels (2x2) that were used for the interpolation by the resulted pixel from the interpolation. I need the about at about 1/4 of its current size.

I'm not so worried about the quality of the downscaled images, as I am about the speed at which it is done. The whole process should be as fast as it can be.

My question is, when I should do the bilinear interpolation during the decompression stage of the JPG. Should I do it after the IDCT (Inverse Discrete Cosine Transform) or should I perform the interpolation before the IDCT?

Is it smart to use the DCT coefficents and do the interpolation on them and then use those resulted values to in the IDCT?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

初吻给了烟 2024-12-30 07:15:03

一般来说,我不认为有任何明智的方法可以根据 DCT 系数来做到这一点。

但是,如果您特别想要每个维度大小一半的图像,则可以通过丢弃高频系数并执行 4x4 IDCT 来获得粗略下采样的图像。

In general, I don't believe there's any sensible way that you can do this in terms of the DCT coefficients.

However, if you specifically want an image of half the size in each dimension, you could get a crudely downsampled image by throwing away the high-frequency coefficients and doing a 4x4 IDCT.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文