linux - How to erase all pixels of certain color on every file inside a folder? -


is there easy way convert images in folder, every pixel specific color removed?

you should define "removed" means. if mean replaced other (background) color, can convert single file this:

convert -fill replacement_color -opaque original_color \         original_image modified_image 

if "removed" mean make pixels transparent, can convert single file this:

convert -transparent original_color original_image modified_image 

where original_image , modified_image input , output image files respectively , original_color , replacement_color original , replacement colors in imagemagick color format.

now, example, replace red pixels white pixels in images in current directory , save them names prefixed "modified_":

for f in *;     convert -fill white -opaque red "$f" "modified_$f" done 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -