0
I asked this question first over on Graphic Design... Since then I was able to learn; and to utilize the fact that a program I was unfamiliar with (ImageMagick) has the capability to output RGB values to the filename using the following:
magick *.png -set colorspace RGB -set filename:f "%[pixel:p]" %[filename:f].png
So I took that step and it worked. Fast forward to the asking of this question here. I have a folder full of image files made up of a single color. I was able to use ImageMagick as shown above to change the filenames to correspond with the colors contained in the respective images. Here is a screenshot from inside the folder:
My only question is: How can I convert the filenames from decimal form to hex?
So, for example, I would like the names of the files to be changed from "rgb(13,12,12).png" to the corresponding hex color code: "0D0C0C.png"
This is turning out to be more difficult than I had hoped... A Windows cmd script or a BAT I could run would be ideal. Can anyone here possibly help me to pull this off?
- I am on Windows 10 and I have installed GOW (GNU On Windows) which affords me the following *nix tool listed here.
Editor's note: The list includes the following programs that (IMO) might be useful: sed, bash, bc, dc, expr, printf (and, of course, mv) — but, notably, not awk.
3
Please note that https://superuser.com is not a free script/code writing service. If you tell us what you have tried so far (include the scripts/code you are already using) and where you are stuck then we can try to help with specific problems. You should also read How do I ask a good question?.
– DavidPostill – 2017-06-02T22:21:35.807