Page 1 of 1

How to Detect colour in a Image.

Posted: 2014-02-27T23:37:36-07:00
by salahuddinonline
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

Re: How to Detect colour in a Image.

Posted: 2014-02-28T03:19:16-07:00
by snibgo
The following command will count the number of pixels that are the required colour.

Code: Select all

convert logo: ( +clone -fill black -opaque #fedcb7 ) -metric AE -compare -format "%[distortion]" info:
You could use it in a script to move images that have a count of more than zero.

Re: How to Detect colour in a Image.

Posted: 2014-02-28T03:39:33-07:00
by salahuddinonline
Its not working snigbo

I want to find a colour in image,,,, if found ,, move this image to another directory

Re: How to Detect colour in a Image.

Posted: 2014-02-28T03:56:52-07:00
by Bonzo
You could use it in a script to move images that have a count of more than zero.
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.

Re: How to Detect colour in a Image.

Posted: 2014-02-28T11:35:08-07:00
by fmw42
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.