colorsimagemagickfiguremogrify

How can I invert the colors of images in bulk by Imagemagick?


I would like to invert the colour of numerous figures in a fold in Linux, the code is as follows:

mogrify /home/yu/Desktop/1 -negate /home/yu/Desktop/2

The origin file is in path 1, and the target fold is path 2.

However, it's wrong. It points out that "mogrify: no decode delegate for this image format `' @ error/constitute.c/ReadImage/562."


Solution

  • You would need to use the -path parameter for "/home/yu/Desktop/2`, and a file pattern -- not just the parent directory.

    mogrify -path /home/yu/Desktop/2 -negate /home/yu/Desktop/1/*.jpg
    

    Be sure to replace *.jpg with whatever file type you are expecting in the source directory.

    remember Remember to define all CLI arguments before the filename pattern when using the mogrify utility.