Find images that are not sRGB (Black/White/Colorless)

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
PRAGMA
Posts: 1
Joined: 2019-06-22T07:25:02-07:00
Authentication code: 1152

Find images that are not sRGB (Black/White/Colorless)

Post by PRAGMA »

I have a folder of like 400k images and I need to find any image that is just black/white or just black or just white or its color profile isnt sRGB.
Currently I do this via -identify and just .contains check it, but it takes ages, it does 5k images within a couple hours, its fairly slow, surely theres a better option then that?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Find images that are not sRGB (Black/White/Colorless)

Post by snibgo »

I suppose you mean that you use "identify -verbose"? That does more work than you need, so you could do it more quickly.

Is your IM HDRI? If it is, and you don't have floating-point images, then you could use an integer IM for faster speeds.

If many of your image files are not sRGB or do not have three channels, you might use exiftool first to filter them out.
snibgo's IM pages: im.snibgo.com
Post Reply