Hi there,
hope all of you are doing great,
I have more then 1000 images in a directory, and I want imagemajick to find colour code which is (fedcb7) in all these images, if colour found, move image to another directory which is named Processed,
can any one help me out on this,
Regards,
Salahuddin
How to Detect colour in a Image.
-
- Posts: 24
- Joined: 2013-07-14T03:36:12-07:00
- Authentication code: 6789
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to Detect colour in a Image.
The following command will count the number of pixels that are the required colour.
You could use it in a script to move images that have a count of more than zero.
Code: Select all
convert logo: ( +clone -fill black -opaque #fedcb7 ) -metric AE -compare -format "%[distortion]" info:
snibgo's IM pages: im.snibgo.com
-
- Posts: 24
- Joined: 2013-07-14T03:36:12-07:00
- Authentication code: 6789
Re: How to Detect colour in a Image.
Its not working snigbo
I want to find a colour in image,,,, if found ,, move this image to another directory
I want to find a colour in image,,,, if found ,, move this image to another directory
Re: How to Detect colour in a Image.
That can not be done with Imagemagick and as snibgo says you will need to write some extra code - batch file, shell script etc. to do the moving.You could use it in a script to move images that have a count of more than zero.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to Detect colour in a Image.
You will need to script a loop over each image, then test for the color, then move it using the OS (not IM) if the color is found. But the scripting method depends upon your OS. Please (always) provide your IM version and platform when asking questions.