bash - 调整大小/裁剪和附加 4 张图像

标签 bash imagemagick

我目前正在使用此命令通过 imagemagick 调整图像大小:

 convert \( ${files[0]} ${files[1]} -append \) \( ${files[2]} ${files[3]} -append \) +append $dir.jpg

enter image description here

处理第二张图片中尺寸不同的图像的最佳方法是什么?我可以指定特定的宽度或高度,并调整图像大小并在图像较小时裁剪到该尺寸,如果它真的很高则裁剪中心,这样我总是能得到与第一张图片相同的结果吗?

谢谢!

最佳答案

尝试将图像调整为相同大小。

for i in *.jpg; do convert $i -resize 80x80 -quality 90 $i.jpg; done

现在您可以附加图像。

调整大小前附加图片

enter image description here

调整大小后附加图像

enter image description here

关于bash - 调整大小/裁剪和附加 4 张图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13344351/

相关文章:

bash - 如何检查 docker 引擎和 docker 容器是否正在运行?

r - 使用 .png 文件在 R 中创建动画 (.gif)

r - 如何一次 image_read 多个图像?

linux - 如何将颜色空间为 YCbCr 的图像转换为 CMYK?

linux - 扫描图像的 ImageMagick 处理

image-processing - 如何从文本图像中删除虚线带?

bash - 用 sed 替换字符串 bash 脚本

bash - 如何将带空格的不带引号的字符串作为带引号的参数传递?

用于提取 IP 地址的 Linux bash 脚本

c - 如何更好地找到Pendrive的挂载路径?