Identify all colours in picture and output to txt ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Rye
Posts: 130
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Identify all colours in picture and output to txt ?

Post by Rye » 2014-06-20T09:58:34-07:00

So.

I'm looking for a way to have ImageMagick analyze a picture completly and output all the colour hex values found in said picture like this (.txt file):

#FFFFFF
#000000
#A7A7AF
....

Is this possible by standart means ?
Version: ImageMagick 6.8.3-4 2013-02-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T10:14:17-07:00

In unix (Linux, Mac OS or Windows with Cygwin) you can do

Code: Select all

convert yourimage txt:- | sed -n 's/^.*[#]\(.*\) .*$/#\1/p'
see txt: at http://www.imagemagick.org/Usage/files/#txt

Rye
Posts: 130
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Identify all colours in picture and output to txt ?

Post by Rye » 2014-06-20T12:03:55-07:00

Is this possible solely using Windows DOS CMD aswell ?
Version: ImageMagick 6.8.3-4 2013-02-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T12:10:57-07:00

Rye wrote:Is this possible solely using Windows DOS CMD aswell ?

Sorry I do not know the Windows equivalent commands. Perhaps some Windows user will be able to help you.

Please, in the future, always identify your version of IM and platform.

For Windows users, some help may be found at http://www.imagemagick.org/Usage/windows/


snibgo
Posts: 9391
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Identify all colours in picture and output to txt ?

Post by snibgo » 2014-06-20T13:26:11-07:00

Very simply: it's the third token in the line, so:

Code: Select all

for /F "usebackq skip=1 tokens=3" %%C ^
in (`%IM%convert ^
  rose: ^
  txt:`) ^
do echo %%C >>x.txt
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T14:29:09-07:00

Does Windows have grep and pipes? If so,
convert yourimage txt: | grep -o "#[^ ]*"

Rye
Posts: 130
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Identify all colours in picture and output to txt ?

Post by Rye » 2014-06-20T14:49:51-07:00

EDIT:

Code: Select all

convert your image txt: | grep -o "#[^ ]*"
Hmm... I installed grep and tried this, however the outputted txt remains unchanged.

Only one problem remains.

Is there a way to only list the DIFFERENT hex codes ?

Output is like this:

Code: Select all

# ImageMagick pixel enumeration: 1248,800,255,srgb
0,0: (168,168,176)  #A8A8B0  srgb(168,168,176)
1,0: (168,168,176)  #A8A8B0  srgb(168,168,176)
2,0: (166,166,174)  #A6A6AE  srgb(166,166,174)
3,0: (166,166,174)  #A6A6AE  srgb(166,166,174)
Is it possible to only list A8A8B0 once ?
Last edited by Rye on 2014-06-20T15:06:50-07:00, edited 1 time in total.
Version: ImageMagick 6.8.3-4 2013-02-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T15:05:52-07:00

What works well? Whose command? If my command then Windows does not seem to allow piping to grep. If you add -unique-colors you will get only colors once, no repeats.

This works for me in Unix

Code: Select all

convert yourimage -unique-colors txt: | grep -o "#[^ ]*"

You can get your output by just using

Code: Select all

convert yourimage -unique-colors txt:
Then you need to use snibgo's Windows commands to extract only the hex values.

see
http://www.imagemagick.org/script/comma ... que-colors
http://www.imagemagick.org/Usage/quantize/#extract

Rye
Posts: 130
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Identify all colours in picture and output to txt ?

Post by Rye » 2014-06-20T15:18:18-07:00

Yep, I'm talking about your command.

The unique-color is exactly what I need.
Now I only need to find out how to format this in windows.
Version: ImageMagick 6.8.3-4 2013-02-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T15:36:09-07:00

Use snibgo's command, but just add -unique-colors before txt:

Rye
Posts: 130
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Identify all colours in picture and output to txt ?

Post by Rye » 2014-06-20T16:18:12-07:00

Snibgo's command outputs it, yet it seems to be in a weird shape:

Code: Select all

43, 
39, 
47, 
41, 
42, 
46, 
37, 
35, 
44, 
45, 
47, 
43, 
39, 
40, 
47, 
45, 
39, 
42, 
42, 
43, 
43, 
42, 
43, 
45, 
45, 
44, 
46, 
47, 
45, 
44, 
44, 
45, 
46, 
47, 
46, 
40, 
43, 
42, 
42, 
47, 
44, 
45, 
47, 
47, 
42, 
43, 
41, 
45, 
44, 
47, 
47, 
41, 
43, 
43, 
44, 
46, 
47, 
47, 
45, 
47, 
47, 
44, 
46, 
51, 
49, 
49, 
50, 
58, 
48, 
50, 
49, 
50, 
48, 
49, 
48, 
48, 
50, 
50, 
51, 
49, 
48, 
49, 
51, 
50, 
52, 
53, 
52, 
52, 
52, 
54, 
54, 
54, 
48, 
50, 
49, 
50, 
52, 
54, 
48, 
48, 
51, 
51, 
50, 
48, 
48, 
51, 
50, 
51, 
48, 
55, 
54, 
55, 
53, 
56, 
57, 
59, 
62, 
39, 
42, 
45, 
46, 
42, 
41, 
41, 
43, 
42, 
43, 
44, 
44, 
47, 
46, 
46, 
45, 
44, 
46, 
45, 
45, 
44, 
47, 
47, 
46, 
45, 
45, 
47, 
46, 
47, 
45, 
47, 
47, 
47, 
41, 
42, 
43, 
45, 
47, 
45, 
47, 
46, 
46, 
45, 
47, 
46, 
45, 
47, 
44, 
47, 
48, 
54, 
57, 
51, 
55, 
50, 
58, 
61, 
48, 
49, 
48, 
51, 
51, 
50, 
55, 
53, 
53, 
52, 
52, 
51, 
49, 
53, 
55, 
53, 
49, 
49, 
51, 
51, 
51, 
50, 
48, 
48, 
50, 
51, 
50, 
48, 
53, 
52, 
55, 
53, 
54, 
54, 
53, 
52, 
54, 
55, 
54, 
54, 
49, 
48, 
51, 
49, 
48, 
48, 
49, 
48, 
51, 
49, 
49, 
50, 
55, 
55, 
52, 
55, 
59, 
62, 
58, 
61, 
60, 
56, 
56, 
56, 
56, 
59, 
57, 
57, 
58, 
58, 
57, 
56, 
59, 
56, 
57, 
56, 
59, 
58, 
62, 
60, 
62, 
59, 
57, 
57, 
58, 
57, 
58, 
61, 
62, 
60, 
62, 
48, 
51, 
49, 
50, 
50, 
53, 
55, 
50, 
50, 
51, 
55, 
53, 
55, 
52, 
55, 
50, 
51, 
49, 
48, 
56, 
61, 
63, 
56, 
56, 
58, 
62, 
62, 
63, 
63, 
59, 
60, 
43, 
45, 
46, 
47, 
44, 
49, 
48, 
50, 
47, 
44, 
47, 
51, 
49, 
51, 
55, 
48, 
50, 
48, 
53, 
55, 
54, 
54, 
51, 
56, 
57, 
57, 
59, 
60, 
59, 
57, 
58, 
57, 
58, 
61, 
60, 
60, 
61, 
61, 
61, 
63, 
63, 
57, 
57, 
58, 
57, 
60, 
50, 
53, 
54, 
52, 
55, 
55, 
52, 
53, 
55, 
52, 
55, 
52, 
54, 
54, 
55, 
50, 
55, 
55, 
53, 
57, 
58, 
56, 
56, 
56, 
60, 
63, 
63, 
62, 
61, 
60, 
58, 
58, 
59, 
56, 
62, 
61, 
60, 
57, 
57, 
58, 
58, 
60, 
62, 
60, 
56, 
56, 
57, 
58, 
58, 
62, 
60, 
62, 
61, 
55, 
60, 
57, 
58, 
61, 
62, 
89, 
73, 
79, 
67, 
70, 
82, 
82, 
82, 
69, 
74, 
66, 
65, 
69, 
65, 
65, 
64, 
68, 
67, 
69, 
65, 
67, 
67, 
67, 
68, 
66, 
64, 
69, 
70, 
72, 
72, 
72, 
73, 
77, 
80, 
82, 
92, 
69, 
65, 
64, 
65, 
71, 
67, 
67, 
75, 
65, 
65, 
66, 
66, 
65, 
67, 
70, 
68, 
69, 
69, 
66, 
64, 
65, 
70, 
69, 
70, 
65, 
66, 
69, 
70, 
75, 
75, 
72, 
73, 
74, 
72, 
79, 
72, 
75, 
74, 
72, 
66, 
64, 
64, 
65, 
65, 
71, 
68, 
95, 
81, 
94, 
80, 
90, 
96, 
54, 
97, 
49, 
50, 
51, 
51, 
99, 
55, 
55, 
55, 
53, 
54, 
54, 
51, 
52, 
52, 
53, 
55, 
52, 
55, 
54, 
55, 
55, 
54, 
61, 
56, 
56, 
58, 
56, 
56, 
57, 
56, 
56, 
60, 
51, 
52, 
54, 
53, 
54, 
54, 
55, 
55, 
51, 
52, 
55, 
54, 
57, 
58, 
62, 
57, 
56, 
56, 
56, 
56, 
57, 
58, 
62, 
59, 
58, 
59, 
56, 
58, 
59, 
59, 
57, 
56, 
56, 
56, 
57, 
59, 
59, 
58, 
57, 
56, 
58, 
58, 
57, 
57, 
57, 
58, 
58, 
58, 
58, 
58, 
61, 
60, 
62, 
54, 
55, 
55, 
55, 
55, 
53, 
55, 
57, 
97, 
61, 
62, 
57, 
58, 
59, 
58, 
60, 
62, 
62, 
61, 
63, 
63, 
61, 
51, 
63, 
54, 
59, 
57, 
56, 
58, 
61, 
61, 
57, 
63, 
61, 
57, 
57, 
57, 
57, 
59, 
58, 
58, 
59, 
58, 
57, 
59, 
60, 
60, 
58, 
60, 
63, 
63, 
63, 
56, 
57, 
50, 
54, 
54, 
54, 
57, 
63, 
61, 
56, 
56, 
60, 
51, 
53, 
53, 
52, 
54, 
55, 
52, 
57, 
57, 
59, 
56, 
59, 
60, 
59, 
56, 
57, 
57, 
56, 
57, 
57, 
58, 
60, 
54, 
56, 
57, 
57, 
62, 
56, 
57, 
59, 
59, 
58, 
59, 
61, 
60, 
59, 
61, 
58, 
65, 
65, 
66, 
71, 
69, 
69, 
75, 
72, 
69, 
71, 
65, 
68, 
70, 
65, 
69, 
80, 
80, 
83, 
83, 
88, 
82, 
67, 
65, 
69, 
71, 
67, 
68, 
70, 
69, 
68, 
64, 
69, 
70, 
75, 
79, 
76, 
79, 
78, 
77, 
74, 
75, 
73, 
77, 
73, 
77, 
76, 
65, 
64, 
67, 
64, 
66, 
75, 
77, 
77, 
76, 
76, 
72, 
76, 
67, 
66, 
68, 
69, 
69, 
68, 
71, 
70, 
69, 
70, 
71, 
72, 
79, 
77, 
72, 
74, 
74, 
78, 
64, 
64, 
68, 
65, 
67, 
74, 
79, 
79, 
77, 
76, 
78, 
85, 
80, 
85, 
84, 
87, 
94, 
89, 
95, 
83, 
85, 
87, 
80, 
81, 
93, 
92, 
92, 
92, 
95, 
93, 
95, 
84, 
82, 
80, 
84, 
86, 
84, 
84, 
85, 
84, 
86, 
87, 
81, 
86, 
85, 
86, 
87, 
86, 
89, 
89, 
89, 
90, 
91, 
90, 
93, 
92, 
94, 
93, 
94, 
94, 
95, 
93, 
94, 
88, 
88, 
89, 
90, 
91, 
91, 
91, 
89, 
91, 
91, 
90, 
92, 
94, 
94, 
95, 
92, 
95, 
95, 
65, 
71, 
76, 
76, 
75, 
73, 
64, 
69, 
66, 
67, 
68, 
66, 
73, 
79, 
79, 
77, 
72, 
76, 
81, 
94, 
85, 
85, 
82, 
83, 
86, 
87, 
86, 
93, 
94, 
93, 
93, 
65, 
99, 
70, 
65, 
69, 
99, 
70, 
97, 
99, 
97, 
64, 
64, 
68, 
65, 
64, 
65, 
72, 
65, 
67, 
66, 
64, 
74, 
77, 
96, 
96, 
96, 
83, 
94, 
71, 
73, 
78,106, 
71, 
71, 
75, 
78, 
79,101, 
71,106, 
76,105, 
76,107, 
89, 
86,100, 
81,111, 
84,117, 
96,120, 
96,127, 
55, 
53, 
61, 
64, 
70, 
74, 
72, 
62, 
58, 
75, 
79, 
77, 
76, 
86, 
85, 
91, 
91, 
92, 
82, 
95, 
89, 
69, 
76, 
73, 
78, 
72, 
79, 
78, 
73, 
86, 
86, 
85, 
91, 
95, 
92, 
95, 
90, 
93, 
87, 
81, 
83, 
83, 
95, 
91, 
94, 
87, 
81, 
95, 
89, 
92, 
95, 
75, 
76, 
86, 
87, 
70, 
87, 
89, 
89, 
94, 
88, 
88, 
93, 
76, 
77, 
96, 
96, 
96, 
98, 
83, 
95, 
96, 
96, 
96, 
90, 
93, 
89, 
92, 
98, 
99, 
91, 
96, 
93, 
92, 
95, 
91, 
91, 
93, 
94, 
95, 
92, 
95, 
94, 
87, 
89, 
84, 
83, 
92, 
95, 
90, 
93, 
95, 
95, 
95, 
97, 
95, 
95, 
95, 
87, 
95, 
77,103, 
83, 
91,102, 
93,101, 
92, 
87,111, 
81,106, 
85,109, 
88,110, 
87,103, 
89,100, 
94,103, 
92,103, 
90,110, 
88,105, 
86,115, 
87,117, 
91,115, 
95,121, 
89,125, 
90,126, 
92,121, 
90,124, 
88,124, 
87,119, 
88,114, 
80,102, 
87,101, 
95,101, 
94,107, 
95,105, 
90,108, 
92,104, 
94,113, 
93,120, 
92,123, 
97,101, 
98, 
98, 
74) 
75) 
98, 
98, 
79) 
79) 
96,106, 
96, 
79) 
96,118, 
67) 
98,127, 
71) 
73) 
73) 
78) 
97, 
83) 
83) 
82) 
82) 
85) 
85) 
96, 
96, 
97, 
97, 
97, 
98, 
98, 
99, 
99, 
98, 
98, 
98, 
99, 
99, 
98, 
97, 
99, 
81) 
83) 
80) 
83) 
97, 
98, 
97, 
97, 
99, 
98, 
98, 
99, 
98, 
99, 
98, 
98, 
86) 
87) 
86) 
87) 
86) 
86) 
87) 
87) 
87) 
85) 
87) 
80) 
82) 
83) 
87) 
81) 
97, 
89) 
90) 
91) 
91) 
88) 
88) 
89) 
90) 
97, 
99, 
99, 
92) 
89) 
88) 
90) 
91) 
98, 
97, 
87) 
82) 
82) 
97,126, 
86) 
83) 
95) 
92) 
95) 
82) 
87) 
88) 
82, 
80, 
69, 
94, 
95, 
93, 
93, 
88, 
91, 
90, 
89, 
82, 
99, 
93, 
82, 
90,106) 
97, 
93,113) 
95,117) 
99, 
99,103) 
#646464 
#6C6A65 
#6F6A65 
#67656C 
99,107) 
96,109) 
#6E6C68 
#70646D 
#677B65 
#64776F 
#68776F 
#6F7B6A 
#7F7664 
#737069 
#7D7B6A 
#7F7F69 
#7A7C6C 
97,114) 
#6D6470 
#70677D 
#776A7C 
#796F7F 
96,112,114) 
#6C7570 
#75777C 
45, 
54, 
53, 
57, 
55, 
54, 
56, 
56, 
57, 
58, 
57, 
57, 
59, 
58, 
60, 
60, 
59, 
57, 
56, 
59, 
57, 
59, 
60, 
61, 
61, 
60, 
61, 
60, 
62, 
60, 
58, 
58, 
58, 
60, 
61, 
59, 
56, 
59, 
60, 
60, 
61, 
60, 
63, 
61, 
61, 
60, 
62, 
54, 
59, 
54, 
55, 
59, 
56, 
58, 
56, 
62, 
61, 
61, 
61, 
61, 
63, 
59, 
59, 
59, 
61, 
61, 
62, 
63, 
60, 
62, 
63, 
61, 
63, 
59, 
56, 
62, 
57, 
63, 
62, 
61, 
63, 
58, 
59, 
60, 
61, 
60, 
60, 
58, 
57, 
63, 
62, 
56, 
61, 
60, 
54, 
61, 
59, 
62, 
62, 
63, 
62, 
61, 
63, 
58, 
52, 
53, 
54, 
54, 
55, 
59, 
59, 
56, 
57, 
59, 
60, 
60, 
57, 
58, 
56, 
54, 
54, 
52, 
57, 
58, 
59, 
57, 
58, 
59, 
61, 
60, 
62, 
56, 
58, 
59, 
58, 
56, 
57, 
57, 
58, 
63, 
61, 
58, 
59, 
59, 
63, 
61, 
60, 
63, 
60, 
55, 
53, 
55, 
55, 
52, 
57, 
58, 
57, 
60, 
59, 
57, 
59, 
58, 
57, 
53, 
54, 
54, 
54, 
55, 
59, 
56, 
58, 
58, 
58, 
56, 
57, 
59, 
58, 
59, 
63, 
61, 
56, 
59, 
63, 
63, 
62, 
60, 
60, 
62, 
58, 
59, 
58, 
56, 
59, 
59, 
57, 
59, 
58, 
56, 
60, 
61, 
61, 
59, 
59, 
57, 
63, 
60, 
61, 
61, 
62, 
63, 
59, 
58, 
61, 
54, 
56, 
56, 
60, 
62, 
62, 
58, 
61, 
59, 
59, 
56, 
58, 
62, 
62, 
62, 
60, 
60, 
63, 
22, 
31, 
46, 
54, 
55, 
55, 
54, 
55, 
55, 
50, 
51, 
52, 
53, 
55, 
52, 
54, 
57, 
61, 
58, 
56, 
60, 
57, 
57, 
56, 
56, 
58, 
61, 
60, 
51, 
54, 
55, 
50, 
53, 
53, 
55, 
54, 
52, 
54, 
53, 
52, 
55, 
53, 
52, 
55, 
51, 
54, 
55, 
56, 
56, 
58, 
56, 
56, 
57, 
59, 
58, 
59, 
56, 
60, 
60, 
62, 
57, 
59, 
56, 
57, 
57, 
59, 
58, 
56, 
56, 
57, 
58, 
57, 
57, 
59, 
56, 
56, 
58, 
57, 
56, 
59, 
58, 
60, 
61, 
62, 
58, 
57, 
58, 
58, 
58, 
52, 
55, 
53, 
51, 
49, 
48, 
49, 
55, 
52, 
53, 
52, 
54, 
52, 
55, 
54, 
56, 
59, 
57, 
56, 
57, 
57, 
49, 
53, 
53, 
55, 
53, 
53, 
52, 
55, 
54, 
54, 
52, 
55, 
53, 
51, 
50, 
51, 
50, 
51, 
49, 
48, 
51, 
55, 
53, 
52, 
55, 
52, 
54, 
53, 
55, 
55, 
57, 
56, 
57, 
58, 
58, 
56, 
58, 
56, 
56, 
56, 
58, 
57, 
58, 
57, 
57, 
58, 
58, 
60, 
60, 
57, 
57, 
57, 
56, 
56, 
57, 
56, 
59, 
62, 
60, 
55, 
51, 
60, 
63, 
63, 
63, 
61, 
61, 
61, 
62, 
62, 
63, 
56, 
59, 
63, 
61, 
62, 
59, 
58, 
57, 
59, 
56, 
60, 
60, 
58, 
57, 
61, 
62, 
63, 
61, 
62, 
52, 
52, 
53, 
48, 
54, 
50, 
50, 
54, 
54, 
52, 
55, 
54, 
53, 
55, 
56, 
58, 
58, 
56, 
56, 
58, 
58, 
59, 
61, 
61, 
60, 
62, 
58, 
60, 
63, 
61, 
61, 
60, 
60, 
60, 
62, 
62, 
63, 
59, 
56, 
56, 
57, 
59, 
62, 
56, 
59, 
58, 
58, 
56, 
56, 
58, 
59, 
59, 
59, 
62, 
61, 
60, 
63, 
55, 
62, 
62, 
63, 
59, 
62, 
59, 
57, 
62, 
60, 
62, 
62, 
45, 
44, 
44, 
47, 
46, 
41, 
33, 
32, 
34, 
45, 
47, 
45, 
43, 
47, 
41, 
43, 
43, 
45, 
48, 
54, 
52, 
54, 
49, 
48, 
49, 
55, 
53, 
52, 
55, 
54, 
55, 
52, 
50, 
51, 
51, 
49, 
52, 
55, 
54, 
52, 
50, 
49, 
49, 
53, 
49, 
53, 
58, 
56, 
57, 
48, 
49, 
48, 
50, 
48, 
50, 
48, 
48, 
37, 
47, 
45, 
45, 
45, 
47, 
39, 
37, 
40, 
42, 
40, 
46, 
47, 
45, 
45, 
46, 
46, 
46, 
44, 
47, 
47, 
35, 
38, 
36, 
39, 
46, 
42, 
40, 
44, 
40, 
42, 
43, 
45, 
52, 
55, 
54, 
55, 
52, 
54, 
54, 
54, 
55, 
54, 
51, 
52, 
53, 
53, 
51, 
51, 
53, 
54, 
54, 
55, 
56, 
59, 
57, 
57, 
57, 
59, 
61, 
60, 
56, 
59, 
56, 
58, 
59, 
56, 
57, 
59, 
60, 
60, 
56, 
56, 
61, 
63, 
61, 
55, 
49, 
52, 
55, 
55, 
54, 
54, 
55, 
54, 
53, 
55, 
55, 
54, 
55, 
54, 
54, 
54, 
54, 
54, 
53, 
55, 
56, 
58, 
59, 
59, 
62, 
62, 
57, 
59, 
60, 
60, 
62, 
56, 
58, 
57, 
56, 
60, 
62, 
56, 
57, 
56, 
56, 
61, 
62, 
62, 
60, 
51, 
50, 
48, 
49, 
48, 
51, 
53, 
54, 
53, 
48, 
63, 
49, 
52, 
55, 
53, 
54, 
50, 
50, 
53, 
55, 
48, 
49, 
51, 
53, 
56, 
60, 
56, 
64, 
64, 
65, 
64, 
65, 
67, 
66, 
67, 
66, 
65, 
65, 
65, 
64, 
70, 
67, 
67, 
71, 
71, 
70, 
66, 
65, 
66, 
67, 
69, 
70, 
69, 
71, 
72, 
72, 
65, 
65, 
64, 
64, 
66, 
64, 
65, 
65, 
69, 
69, 
64, 
65, 
67, 
69, 
68, 
70, 
75, 
64, 
66, 
65, 
64, 
68, 
65, 
64, 
67, 
64, 
64, 
68, 
66, 
69, 
71, 
71, 
72, 
73, 
72, 
64, 
64, 
67, 
66, 
66, 
66, 
64, 
64, 
64, 
64, 
67, 
64, 
66, 
66, 
66, 
67, 
69, 
69, 
67, 
69, 
69, 
64, 
65, 
64, 
64, 
64, 
64, 
68, 
69, 
68, 
64, 
64, 
65, 
67, 
66, 
72, 
72, 
72, 
65, 
68, 
65, 
66, 
64, 
66, 
69, 
70, 
67, 
66, 
67, 
69, 
70, 
68, 
70, 
66, 
68, 
71, 
68, 
64, 
67, 
65, 
65, 
68, 
69, 
71, 
72, 
74, 
64, 
68, 
64, 
68, 
65, 
66, 
64, 
65, 
69, 
62, 
60, 
62, 
58, 
63, 
63, 
62, 
59, 
46, 
45, 
40, 
41, 
44, 
62, 
63, 
61, 
62, 
61, 
63, 
60, 
56, 
57, 
60, 
60, 
61, 
59, 
60, 
60, 
52, 
62, 
46, 
61, 
48, 
63, 
59, 
62, 
61, 
52, 
63, 
61, 
55, 
54,103) 
63, 
62, 
56,101) 
59,100) 
60,100) 
58,104) 
62,104) 
58,111) 
62,113) 
66, 
71, 
75, 
73, 
75, 
77, 
79, 
78, 
69, 
66, 
69, 
67, 
65, 
70, 
71, 
81, 
84, 
89, 
84, 
87, 
93, 
89, 
90, 
83, 
90, 
84, 
81, 
81, 
82, 
85, 
81, 
83, 
90, 
78, 
91, 
92, 
95, 
85, 
86, 
89, 
89, 
89, 
89, 
66, 
73, 
72, 
79, 
67, 
75, 
64, 
69, 
79, 
82, 
82, 
80, 
88, 
87, 
85, 
91, 
84, 
89, 
99, 
99, 
79) 
86) 
83) 
97, 
95) 
93) 
95) 
83) 
95) 
94) 
93) 
82) 
93,123) 
#876E64 
#996A64 
98,110) 
#927565 
96) 
#A07964 
#A1746E 
#BF7A72 
#B9767C 
71, 
76, 
73, 
77, 
73, 
79, 
78, 
76, 
67, 
67, 
64, 
67, 
64, 
69, 
69, 
68, 
70, 
69, 
65, 
71, 
67, 
67, 
65, 
69, 
69, 
68, 
69, 
66, 
66, 
68, 
70, 
68, 
68, 
75, 
72, 
72, 
72, 
75, 
72, 
74, 
76, 
73, 
73, 
71, 
69, 
65, 
79, 
74, 
72, 
77, 
78, 
78, 
85, 
80, 
86, 
81, 
81, 
80, 
86, 
88, 
75, 
79, 
79, 
64, 
74, 
73, 
64, 
79, 
75, 
72, 
77, 
85, 
83, 
88, 
89, 
92, 
66, 
66, 
68, 
64, 
64, 
67, 
64, 
68, 
69, 
71, 
64, 
65, 
66, 
65, 
64, 
67, 
66, 
71, 
68, 
73, 
73, 
77, 
73, 
77, 
71, 
66, 
69, 
70, 
67, 
73, 
78, 
76, 
76, 
75, 
68, 
67, 
66, 
70, 
68, 
70, 
65, 
68, 
72, 
72, 
74, 
80, 
83, 
82, 
74, 
75, 
76, 
70, 
65, 
64, 
78, 
74, 
75, 
77, 
68, 
77, 
79, 
82, 
81, 
85, 
86, 
85, 
81, 
83, 
85, 
94, 
83, 
86, 
87, 
86, 
93, 
90, 
94, 
82, 
84, 
87, 
88) 
99, 
92) 
80, 
91,102) 
93,110) 
87,107) 
95,109) 
67, 
65,100) 
66, 
68, 
70, 
66,103) 
72, 
77,100) 
64,104) 
67,106) 
70,104) 
71,111) 
74,110) 
74,110) 
78,111) 
92, 
90, 
89,104) 
84, 
86, 
81, 
80, 
83,103) 
87,101) 
86,101) 
91,103) 
94,102) 
80,107) 
85,104) 
80,109) 
87,108) 
86,110) 
87,111) 
90,105) 
92,109) 
65,114) 
69,119) 
74,116) 
77,122) 
75,125) 
82,112) 
87,112) 
85,113) 
84,116) 
90,117) 
89,116) 
82,122) 
85,120) 
87,120) 
88,122) 
90,120) 
89,127) 
#D66C67 
#DB666E 
#D46A72 
#CD7F7F 
#D67171 
97,103) 
#E7666B 
#E76B6B 
97,103) 
#FF6765 
98,109) 
#FF646C 
#FF646F 
#F06D6A 
#F36E6A 
#F7696D 
#F76E6D 
98,112) 
#F16771 
#F66770 
#F56577 
96,112) 
99,112) 
98,119) 
#FE6676 
#FF6676 
#FA6E71 
#FA6875 
#FB6F75 
#FF6F7A 
#FC6B7C 
#EE7172 
#ED7472 
#E37975 
#EC7973 
#F67571 
#F17278 
#F7737E 
#FA727B 
#FD737B 
#FF727F 
93,131, 
93,132, 
90,130, 
95,132, 
92,128, 
94,135, 
92,132, 
95,130, 
95,135, 
95,129, 
94,134, 
67) 
98,138, 
69) 
71) 
71) 
97,140, 
99,140, 
68) 
69) 
71) 
71) 
96,131, 
99,130, 
72) 
75) 
97,133, 
99,134, 
97,133, 
74) 
98,130, 
98,129, 
78) 
75) 
76) 
76) 
96,139, 
98,138, 
75) 
98,140, 
74) 
96,136, 
98,136, 
77) 
76) 
78) 
72) 
75) 
77) 
76) 
79) 
70) 
71) 
75) 
74) 
75) 
73) 
74) 
76) 
77) 
79) 
78) 
77) 
73) 
77) 
74) 
75) 
79) 
78) 
78) 
81) 
87) 
92) 
89) 
89) 
92) 
92) 
80) 
82) 
83) 
81) 
81) 
82) 
85) 
87) 
84) 
92) 
81) 
83) 
84) 
80) 
80) 
83) 
81) 
81) 
80) 
80) 
84) 
87) 
81) 
89) 
91) 
90) 
88) 
92) 
94) 
88) 
90) 
89) 
92) 
95) 
95) 
94) 
80) 
86) 
86) 
85) 
86) 
85) 
89) 
91) 
92) 
94) 
89) 
90) 
#648765 
#6C8267 
#688664 
#6F8B6A 
#6F896C 
96) 
#738F64 
#75816E 
#758869 
#659267 
99) 
#6F936F 
#6B9868 
96) 
99) 
#7D9A67 
#7E916A 
#7B9C6A 
#7A9B6D 
#7E9D6D 
#728170 
#768E70 
#7D807E 
#749574 
#7A9271 
#739C74 
#779679 
#769E7C 
#7E987B 
99) 
#7AA164 
#7EA366 
#7BA664 
#7CA566 
96) 
98) 
#79A168 
#7EA36F 
#7FA56F 
#7FA86B 
#7EB065 
#7DA574 
#7FAB70 
#7EA17B 
94) 
#818B64 
#869865 
#809F68 
#889B6A 
#84817C 
#80867E 
#8F8A79 
#938170 
#8B9776 
#88977C 
#809E78 
#A3917B 
#A0917C 
97) 
#85A66F 
#88AB6F 
#92A569 
#87B368 
#86B26E 
#82B96F 
#8EA173 
#83AA71 
#85AA71 
#89AA76 
#8CAA76 
#8FA07E 
#84AF7E 
#8FAA7C 
#91A276 
#98A07D 
#9DA77F 
#94AC7F 
#87B170 
#86B674 
#8DB979 
#9DB671 
#A5B979 
#EF857F 
#FE817A 
#FF807C 
92, 
81, 
91, 
92,158) 
97,101,135) 
#6E6D8E 
#7E7889 
#6C6A91 
#6D659B 
#6E6C9F 
#69709E 
#7A7491 
#77779A 
#7C779B 
#77789A 
#7B799E 
93, 
91, 
93,102,175) 
#666DA6 
99,108,172) 
#6C70A5 
#7370A7 
#7773A5 
#7C78A0 
#7D7CA0 
#7F7AA4 
#7078A8 
#7F7AAF 
99,106,180) 
#6969BB 
#6F7AB6 
#747AB4 
#7B7BB6 
#7176B8 
#777CB9 
#6C76C1 
#6B71C6 
#797BCE 
#7A7AD6 
#797CD6 
#817793 
#86739B 
#BA768D 
#8C7CA6 
#867DAB 
#817DB2 
#9B7EB4 
#AB71A3 
#C56995 
#EE7B80 
#E47B88 
#FD7181 
#FC7782 
#FD7A83 
#FC7C84 
#FF7B88 
#FF7A8B 
#807CC2 
#877FC4 
#817FD1 
#7C8F81 
#7C8A86 
#7BAF88 
#7F80AA 
#7F86B5 
#7C86C6 
#7E87D0 
#858D83 
#838788 
#809681 
#82968C 
#96978E 
#959A90 
#9E9997 
#9A9F95 
#919E98 
#85A184 
#87AD82 
#8CA28E 
#8CAB8C 
#89AD8E 
#90A98B 
#8FBC86 
#83B18C 
#9CB689 
#95B88E 
#96A497 
#95A19C 
#98A09A 
#8FB697 
#99BA98 
#A2A185 
#A0B382 
#A3A098 
#B8B591 
#B5B699 
#B4B09F 
#8083A5 
#8782AD 
#8481B7 
#8280BA 
#8785BE 
#8A87BD 
#8E85BF 
#838BBD 
#AA81AE 
#B387A6 
#8FA5A3 
#A0A7AF 
#B4AFA5 
#B6B5AD 
#BAAFB7 
#A7B3B9 
#B0B1B1 
#B5BAB0 
#C2879B 
#FF8189 
#FF878B 
#FE888F 
#FF8F90 
#FF9395 
#C7A38E 
#C8B696 
#DEB29E 
#C0B5A6 
#D1BDA7 
#C5B5B3 
#C6BFB3 
#C9BEB6 
#C2B7BC 
#C0BFB8 
#C3BFBE 
#E1AAA4 
#9DC393 
#A0C98C 
#A8D48C 
#A8C79A 
#B6D59A 
#AFCAAA 
#A4C7B0 
#A6CAB3 
#C9C0AE 
#CBCCAE 
#DAC3AC 
#CED5BA 
#D1D2B6 
#D3D2B7 
#DAD9B8 
#E8D4BC 
#EBE8AB 
#F8F2A4 
#E4E1B6 
#8484C7 
#8D86C2 
#848EC1 
#8F8FC5 
#8185CA 
#8D85C8 
#8885CD 
#8986CD 
#8D8DCE 
#9589C1 
#9983CD 
#9A9BC7 
#9E96CE 
#9A9DCE 
#8382D2 
#8881D2 
#8C8BD1 
#8282DA 
#8B82DB 
#8B8DD8 
#8989DD 
#8B88DF 
#918CD4 
#8890D0 
#9497D4 
#949FD8 
#9099DE 
#989DDF 
#9D9DDE 
#A09BD6 
#A2A1D6 
#AFACDB 
#8588EB 
#838CEA 
#928FEA 
#9597E4 
#9390F6 
#9EA5E4 
#99A2EC 
#9DA1EC 
#9CA0ED 
#A1ABE0 
#A7A7EF 
#A3A4F6 
#A4ADF0 
#AEADF6 
#A4A4FF 
#A6AEFB 
#A0AFFE 
#A4ADFF 
#A9ACF9 
#ACB2FF 
#ABB8FF 
#B0B2FF 
#B2B4FF 
#B5BEFF 
#B9BEFF 
#BCC3C5 
#BAC6CD 
#CDCCC7 
#C8CDC9 
#DDC4C0 
#D3C8C1 
#D1CBC6 
#DDCBC5 
#DCCEC9 
#DAD7C1 
#DDD4C7 
#DDDAC6 
#D8D3C8 
#C3CDD5 
#D3CED2 
#D4CCD3 
#CFD1D1 
#C3D0D9 
#C8D2D9 
#D8D7D7 
#E0C3C4 
#E4DBC0 
#E5D8C8 
#F1D3C9 
#EEDED4 
#EADCDB 
#E9DEDE 
#F4DDD5 
#F0DFD8 
#C5EBC8 
#D4E2C6 
#DDE3C3 
#E9E6CD 
#EAE8CE 
#EAF3CC 
#E7EFD2 
#E3EAD7 
#E2EFD5 
#EFE6DB 
#EDE7DC 
#E5E8DE 
#E9EDDC 
#EEEEDC 
#F1E5D4 
#F4E6D6 
#FAE0D6 
#F2E8DD 
#F0F1D9 
#FAF8DE 
#C1C4E7 
#E6D6F0 
#D9E2E8 
#EFE0E1 
#E9E0E6 
#EBEDE4 
#E0E0EA 
#E2E7EB 
#F3E6E5 
#FAE1E0 
#F0E6EE 
#F6ECE8 
#F2E9EC 
#E2F9E6 
#F0F7E1 
#F2F7E0 
#F2F0E7 
#F9F2E0 
#F8F4E4 
#FEF8E2 
#FDF8E6 
#FDFAEA 
#FBFCE9 
#FFFEEB 
#F9FBEE 
#F8FCED 
#FAFCEE 
#FFFFED 
#FFFFEF 
#FFFFEE 
#F5E7F0 
#FAEFF0 
#F5E1F9 
#EEFFF0 
#EFFBFC 
#F2F2F1 
#FDF4F3 
#FEF0F4 
#F7FAF0 
#F8FBF1 
#F8FAF3 
#FAFBF2 
#FFFEF1 
#FFFFF2 
#FCF8F4 
#FEFAF5 
#FFFAF5 
#FEF9F7 
#F9FFF5 
#FBFFF7 
#FDFCF7 
#FFFFF7 
#FDF3F9 
#FFF5FA 
#FFF5FF 
#F5FAFA 
#FFFAF9 
#FEFAFB 
#FFFDF9 
#FDFFF8 
#FFFFF9 
#FFFCFB 
#FFFDFA 
#FFFDFB 
#FDFFFA 
#FFFEFB 
#FFFFFA 
#FEFFFA 
#FAFBFD 
#FFF9FD 
#FFF8FF 
#FFFAFF 
#FEFAFF 
#FAFFFC 
#FAFFFD 
#FBFFFC 
#F9FFFF 
#FAFFFF 
#FBFFFE 
#FBFEFF 
#FFFCFC 
#FFFDFD 
#FFFFFC 
#FFFEFC 
#FFFFFD 
#FEFEFC 
#FEFFFC 
#FEFFFD 
#FDFDFE 
#FFFDFF 
#FFFCFE 
#FEFDFF 
#FCFFFF 
#FDFEFF 
#FDFFFE 
#FDFEFE 
#FDFFFF 
#FFFFFF 
#FFFFFE 
#FFFEFF 
#FEFFFF 
#FFFEFE 
#FEFEFE 
Version: ImageMagick 6.8.3-4 2013-02-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T16:53:01-07:00

Look like it is getting one of the color values. Seems like his command is not working quite right. This may happen if one of the color values has a space in it. I am sure he can fix it when he gets back on line.

To help him analyze the problem, can you post your actual image that you used?


Did you replace "yourimage" with an actual image name in my command

Code: Select all

convert yourimage txt: | grep -o "#[^ ]*"

User avatar
fmw42
Posts: 22095
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Identify all colours in picture and output to txt ?

Post by fmw42 » 2014-06-20T17:02:06-07:00

Did you try his command exactly using the rose: image?

Code: Select all

for /F "usebackq skip=1 tokens=3" %%C ^
in (`%IM%convert ^
  rose: ^
  txt:`) ^
do echo %%C >>x.txt
If that does not work, then try adding -depth 8 before txt:

Code: Select all

for /F "usebackq skip=1 tokens=3" %%C ^
in (`%IM%convert ^
  rose: ^
  -depth 8 ^
  txt:`) ^
do echo %%C >>x.txt
If that works, try your image in place of rose:

Rye
Posts: 130
Joined: 2013-02-25T10:43:05-07:00
Authentication code: 6789

Re: Identify all colours in picture and output to txt ?

Post by Rye » 2014-06-21T01:54:04-07:00

Well...
I tried both of your commands.


In my folder I have this:

Code: Select all

001.gif
hex_color.bat
I pasted both codes (one after another) into the hex_color.bat and started it.

Same results as last time.
replacing the rose with 001.gif didn't do any difference to the end result either.
Last edited by Rye on 2017-06-17T13:39:36-07:00, edited 1 time in total.
Version: ImageMagick 6.8.3-4 2013-02-20 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib fontconfig freetype jng jp2 jpeg lcms lzma pango png ps tiff x xml zlib

Post Reply