将图像的区域分为瓷砖

发布于 2025-01-22 19:54:42 字数 481 浏览 1 评论 0原文

我有一组4500px x 3000px的图像。

在这些图像中的每一个中,我需要在5列中提取一组瓷砖,乘3行组合,每个瓷砖宽700px乘500px高。

上述复杂的是,该的起点需要在图像的左上角x:650和y:450位置。

我已经掌握了转换image.jpg -gravity Northwest -Chop 650x450 -crop 700x500 Tile-%d.jpg

这使我进入了正确的开始位置,以创建瓷砖集,但包括其余的一部分图像的右侧和底部边缘的空白区域。

我该如何解决这个问题?

“

I have a set of images that are 4500px x 3000px in size.

Out of each of these images I need to extract a set of tiles in a 5 columns by 3 rows combination with each tile being 700px wide by 500px high.

What complicates the above is that the starting point for this needs to be at X:650 and Y:450 position from the top left corner of the image.

I have gotten as far as convert image.jpg -gravity NorthWest -chop 650x450 -crop 700x500 tile-%d.jpg

This gets me to a correct start position for creating the tile set but includes the rest of the blank area in the right and bottom edge of the image.

How do I go about solving this?

Illustration of the problem

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

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

发布评论

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

评论(1

野鹿林 2025-01-29 19:54:42

在一个ImageMagick命令中,您可以首先包含所有图块的初始矩形,然后将其裁剪成15张输出图像。尝试这样的事情...

convert image.jpg -crop 3500x1500+650+450 -crop 5x3@ tile-%02d.jpg

Within a single ImageMagick command you can crop the initial rectangle that contains all the tiles first, then crop that into the 15 output images. Try something like this...

convert image.jpg -crop 3500x1500+650+450 -crop 5x3@ tile-%02d.jpg
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文