简体   繁体   English

使用magicmagick或imagemagick进行90度图像旋转时是否无损

[英]Is 90 degree image rotation with graphicsmagick or imagemagick lossless

Is the 90 degree image rotation with graphicsmagick or imagemagick always lossless? 使用magicmagick或imagemagick进行的90度图像旋转是否始终无损?

Eg when doing 例如做的时候

gm convert -rotate 90 img.img rot90.img.img
gm convert -rotate -90 rot90.img.img back.img

will img.img and back.img be equal? img.img和back.img是否相等?

The answer to this depends more on the particular image format you're using, rather than the internals of Image/GraphicsMagick (assuming they're competently written). 解决方案更多地取决于您使用的特定图像格式,而不是Image / GraphicsMagick的内部结构(假定它们是熟练编写的)。

With a raw format (eg BMP), there should be no reason for this not to be completely identical. 对于原始格式(例如BMP),应该没有理由不完全相同。

With a lossless format, it's possible there may be some subtle variations due to numerical precision. 使用无损格式时,由于数值精度,可能会有一些细微的变化。

With a lossy format (eg JPEG), it's almost certain there will be differences. 对于有损格式(例如JPEG),几乎可以肯定会有所不同。 In the case of JPEG for example, the compression of each 8x8 block is affected by the block to its left - if you rotate the image then that spatial relationship will change. 例如,对于JPEG,每个8x8块的压缩受其左侧的块影响-如果旋转图像,则该空间关系将改变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM