【问题标题】:How to convert a bunch of images to black and white with overwritting existing ones?如何通过覆盖现有图像将一堆图像转换为黑白图像?
【发布时间】:2021-12-05 00:37:06
【问题描述】:

我需要将一堆图像(大约 1000 张)转换为黑白我使用了以下代码:

convert *.bmp -monochrome ./*.bmp

但它会产生新的图像。例如,我有 file1.bmp、file2.bmp 等,它将它们转换为 file1-1.bmp file2-2.bmp 等等。我需要完全相同的图像名称,所以我更喜欢覆盖现有的名称。任何建议。谢谢!

【问题讨论】:

  • 使用mogrify 而不是convert

标签: linux image-processing command-line imagemagick ubuntu-16.04


【解决方案1】:

用途:

mogrify -monochrome *.bmp

请注意,此旧 v6 语法与您的 convert 匹配。

现代 v7 语法是:

magick mogrify -monochrome *.bmp

【讨论】:

    猜你喜欢
    • 2011-11-29
    • 1970-01-01
    • 2013-03-17
    • 1970-01-01
    • 1970-01-01
    • 2012-06-15
    • 1970-01-01
    • 2013-04-21
    • 2021-02-27
    相关资源
    最近更新 更多