如何使用 jpeg 对包含单行的图像进行编码

how to encode Image containing single row using jpeg

在阅读 jpeg 规范时,我了解到在对 jpeg 进行编码时,图像首先被分解为 8x8 块,然后发生 DCT 和其他事情。 所以我很想知道如何使用 jpeg 对包含单行的图像(原始文件)进行编码? jpeg 会向文件添加额外的 7 行以便它可以将其分成 8x8 块吗?

在 JPEG 压缩中,不是 MCU 大小倍数的图像会向上填充到该大小。

https://dsp.stackexchange.com/questions/35339/jpeg-dct-padding

中给出了非常好的解释

From Baseline JPEG:

The image is partitioned into blocks of size 8x8. Each block is then independently transformed using the 8x8 DCT. If the image dimensions are not exact multiples of 8, the blocks on the lower and right hand boundaries may be only partially occupied. These boundary blocks must be padded to the full 8x8 block size and processed in an identical fashion to every other block. The compressor is free to select the value used to pad partial boundary blocks.