Massive stack (50k+) of images to determine histogram

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
JC_Chicago
Posts: 3
Joined: 2017-07-24T12:46:36-07:00
Authentication code: 1151

Massive stack (50k+) of images to determine histogram

Post by JC_Chicago »

I am able to successfully obtain histogram image data, but on only one image at a time.
I have more than 50k images that need to be reviewed, but then, and this is vital, export a simply text file (csv) with the file name and subsequent histogram.
Yes, I can put several thousand into one file, to break the process into logical pieces, and to make the exported csv file more manageable.
Thoughts?
Running 7.0.6 on a PC.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Massive stack (50k+) of images to determine histogram

Post by snibgo »

I don't understand what you are asking.

You can write the data you want from one image to a CSV file, correct? Then you can put that in a FOR loop to loop through all the image files, appending to that CSV file.
snibgo's IM pages: im.snibgo.com
JC_Chicago
Posts: 3
Joined: 2017-07-24T12:46:36-07:00
Authentication code: 1151

Re: Massive stack (50k+) of images to determine histogram

Post by JC_Chicago »

No, I apologize, for I am unable to determine how to export the data from even one reviewed image. I've reviewed the community board but can't find anything about it.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Massive stack (50k+) of images to determine histogram

Post by fmw42 »

try

Code: Select all

convert image -format "%c" histogram:info: > histogram.txt
Is that what you want?
JC_Chicago
Posts: 3
Joined: 2017-07-24T12:46:36-07:00
Authentication code: 1151

Re: Massive stack (50k+) of images to determine histogram

Post by JC_Chicago »

Okay, yes, thank you!, that is what I needed on a per frame basis, but now to do this for more than one image...
My *.bat file is failing to allow more than one command at a time, and boy, do I feel like an idiot now! I've used and written *.bat files for years, and now this simple command can't be replicated multiple times? Thank you for helping me through this seemingly easy task for everyone else.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Massive stack (50k+) of images to determine histogram

Post by snibgo »

I create one text file from a subset of jpg files. The output has the filename on one line, then the histogram.

Code: Select all

(
  for %%F in (af*.jpg) do @convert %%F -format "%%f\n%%c\n" histogram:info:
) > histogram.txt
snibgo's IM pages: im.snibgo.com
Post Reply