In this question, someone asked how to get the average colour of an image in hexadecimal notation. After some research, I found a somewhat working solution using ImageMagick:
user@laptop:~$ convert rose: -scale 1x1\! -format '%[pixel:s]\n' info:-
The problem is that this prints srgb(146,89,80)
instead of the desired #925950
.
I tried reading through the documentation of -format
, which did mention a %[hex:]
"thing", but when substituting %[pixel:s]
for %[hex:s]
, I get the following error:
convert: unknown image property "%[hex:s]" @ warning/property.c/InterpretImageProperties/3678.
I also tried reading the documentation for FX Expressions
, but I have no idea how I would go about outputting the result as hex code instead of SRGB.