如何使用ImageMagick避免这种换行/图像失真?

huangapple go评论91阅读模式
英文:

How can I avoid this line break/image distortion with ImageMagick?

问题

我正在测试使用ImageMagick的能力来将图像文件连接在一起,以创建一个新项目的图像精灵创建函数,使用imagick PHP扩展。

我将图像精灵分为每个32个图像一组的块,压缩精灵,显示它们的JPEG和WEBP版本,并显示一个未分解为每个精灵32个图像的未压缩WEBP精灵。

所以这就是您在下面看到的内容:

如何使用ImageMagick避免这种换行/图像失真?

如您所见,右侧的图像(对于可能具有挑衅性内容的图片,我很抱歉...它们只是从flickr中获取的随机公共领域图像)是精灵的非分块非压缩WEBP版本,其中一个图像中有一个明显的锐利/明显的线条。

为什么会这样?

它被称为什么?

我该如何让它消失?

提前感谢您!

英文:

I am testing out using ImageMagick's ability to concatenate image files together for an image sprite creation function for a new project using the imagick PHP extension.

I create the image sprite in chunks of 32 images each, compress the sprite, display each of them in JPEG and WEBP versions and also display an uncompressed WEBP sprite that is not broken down into 32 images per sprite.

So that's what you are looking at below:

如何使用ImageMagick避免这种换行/图像失真?

And as you can see on the image to the right (sorry for the possibly inflamatory content... they're just random public domain images taken from flickr) which is the non chunked non compressed WEBP version of the sprite.. there is a sharp/obvious line in the center of one of the images in the sprite.

Why is that?

What is it called?

And how can I make it go away?

Thanks in advance!

答案1

得分: 1

第三张图片中的水平断裂是在首先进行放大,然后合成时发生的。在这种情况下,放大不能超越一个碎片的边缘并且必须进行外推,它通过执行您所看到的操作来实现这一点。

您需要首先进行合成,然后再进行放大。

英文:

如何使用ImageMagick避免这种换行/图像失真?

That horizontal break in the third picture happens when pieces are first upscaled, then composed. In that case, the upscaling can't look beyond one piece's edge and has to extrapolate, and it does that by doing what you see.

You need to compose first, then upscale.

huangapple
  • 本文由 发表于 2023年6月26日 08:52:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76552956.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定