I am looking for a tool to scan a folder and create a report of color profiles of each image. The report should be a list with 1st column "File Name" and 2nd column should be "Color Profile". We have a hundred thousands images in which some had been scanned and attached with a cmyk color profile which cause some problems when trying to display them in a software we're using.
This can be done using a combination of ImageMagick and shell commands. I'll use Windows batch since there was no specification of an operating system, but it can be done similarily with bash. I used the .png and .jpg extensions, and you can add to the list depending on your files.
- Install ImageMagick and include the directory in the Windows
- Create an empty batch file in the images directory,
- Edit the file and paste the following lines:
@echo off set "TAB= " echo File Name%TAB%Color Profile > color_report.txt for %%f in (*.png,*.jpg) do ( echo. >> color_report.txt <nul set /p =%%f%TAB% >> color_report.txt identify -format %%[colorspace] %%f >> color_report.txt ) color_report.txt
- Save and run in command line. The result should look somewhat like this:
File Name Color Profile xx.png sRGB yy.png sRGB 12345.jpg CMYK etc.jpg sRGB
- If you'd like to filter out the CMYK results, use the following command after the first file is generated:
findstr "CMYK" color_report.txt > cmyk_list.txt && cmyk_list.txt