[“求知“一期] 什么是抖动?如何利用抖动缩减图片的大小

这会是一个不错的系列, 我会继续学习国内外优秀的博主 ,毕竟太菜了, 不会憋出来什么高质量的产出, 显然这不是原创,只会是 转载/翻译,

 可能会加入一些自己的理解和拓展资料


出处: 

Why Your Website Should Use Dithered Images | endtimes.devhttps://endtimes.dev/why-you-should-dither-images

Dither - Wikipedia (维基,你懂得)icon-default.png?t=LA92https://en.wikipedia.org/wiki/Dither 

目录

抖动

无损压缩

有损压缩

一个在线抖动处理的工具


抖动

Oversized images have a negative impact on your site's speed, accessibility, seo, and on the climate.

过大的图片会对网站的速度、可访问性、搜索引擎优化和气候产生负面影响 

Dithering is a retro way of reducing the colors in an image for use on old hardware or in print. It removes colors, and strategically place dots to emulate the missing shades.

抖动是一种在旧硬件或打印中使用的减少图像颜色的复古方法。它可以去除颜色“有策略地放置点来模仿缺失的阴影"

Dithering simulates all the missing shades with a diffusion of dots .

抖动用扩散的点来模拟所有缺失的阴影

It swaps pixel brightness with dot density. The denser the dots, the darker the shade.

它用点密度来交换像素亮度。点的密度越大,阴影就越暗。

Dithering works with any color palette too. You can apply the same idea above, but for each color in a pixel: redgreenblue.

抖动也适用于任何调色板。你可以应用上面的想法,但是对于像素中的每一种颜色:红、绿、蓝。

 Dithering turns images that would normally need to be compressed with lossy compression, into images that compress very well with lossless compression.

抖动通常需要用有损压缩压缩的图像转化为用无损压缩压缩得很好的图像

无损压缩

lossless compression, the type used by png files, works by finding repeated sequences of pixels — then encoding a shortcut for that sequence.

无损压缩,PNG文件使用的类型,工作原理是找到重复的像素序列,然后为该序列编码一个快捷方式

None of the information from the original post would be lost.

原始帖子中的信息不会丢失

适用情况:当你的图像有许多重复的像素序列。但是全颜色的照片几乎没有重复序列——每个像素与其相邻像素略有不同。因此,使用有损压缩技术

有损压缩

Lossy compression, the type used in jpeg files, is way more complicated. It doesn't work at all like lossless compression. It removes information specifically in ways that are hard for humans to perceive.

有损压缩(jpeg文件中使用的压缩类型)要复杂得多。它完全不像无损压缩那样工作。它以人类难以感知的方式去除信息。

jpeg does a really good job compressing photos. It's great if the image contains fluffy real life things like rabbits and clouds.

However, if a jpeg contains stark contrasts and sharp lines, like text, graphics, or dithered images. It fails.

Jpeg在压缩照片方面做得很好。如果图片中有毛茸茸的现实生活中的东西,比如兔子和云,那就太棒了。

然而,如果jpeg包含鲜明的对比和尖锐的线条,如文本、图形或抖动图像。它就失败了。

The new-ish image format webp has both lossy and lossless modes, and results in even smaller dithered images.

新的图像格式webp有有损和无损两种模式,结果是更小的抖动图像。

一个在线抖动处理的工具

Dither Me This | Online Image Dithering Tool (doodad.dev)icon-default.png?t=LA92https://doodad.dev/dither-me-this/


有关抖动的实现细节,译者泥烟会继续学习 

原文地址:https://www.cnblogs.com/Knight02/p/15799019.html