GeeMack wrote:
Windows will let you use commas and parentheses in filenames you can also easily convert the images and save with output filenames formatted like "rgb(255,60,30).png", "rgb(28,112,182).png", "rgb(37,95,51).png", etc., using an IM command like this...
Code: Select all
magick 2016*.png -set colorspace RGB -set filename:f "%[pixel:p]" %[filename:f].png
Nice! This works perfectly. So I now have a folder with the RGB values as the filenames as you've shown.
This gets me one step closer to what I'm trying to accomplish. Thanks a lot for this...
GeeMack wrote:
Converting decimal to hex in a Windows BAT script can be done without external programs, but it's a bit clunky. There are *nix tools like "sed" and "awk" and "printf" available to run on a Windows CMD shell. The output of IM's "info:" or "txt:" can be used in a fairly simple BAT script using "printf", for example, to convert decimal to hex, then do a "ren" from the script as snibgo mentioned.
Here you've lost me I'm afraid!
I've installed GOW (GNU On Windows) which does give me the "printf" capability - but as for how to use this to batch process all of my filenames, or how to transfer those results to the renaming of the correct files in my folder... this is way over my head I think.
I've spent hours now searching through posts here and there on decimal to hex conversions, etc and I'm more confused now than I was to begin with!
Perhaps it will be simpler for me to just manually sample the color, copy the hex code and rename all of the files? There are hundreds of files though so it is a daunting task. I had hoped there was some easy way to just grab only the hex values from the output of histogram:info or some such function, and send that to the filename.
It seems that these days outputting a hex color code would be more useful than decimal RGB values, so it seems odd that ImageMagick can do one but not the other... Is there something I'm missing here?
Anyhow you mentioned clunky decimal to hex BAT... I don't mind clunky as long as it works! Do you have a link or can you paste it here or something?
Thanks again, I really do appreciate your time.