Page 1 of 1

how I could convert image to text without output name of color ?

Posted: 2018-07-20T09:21:07-07:00
by diegomage
I need to convert a image but this convertion output color name

Code: Select all

53,62: (32896,32896,32896)  #808080  fractal
54,62: (0,0,0)  #000000  black
55,62: (0,0,0)  #000000  black
56,62: (0,0,0)  #000000  black
57,62: (0,0,0)  #000000  black
58,62: (0,0,0)  #000000  black
59,62: (32896,32896,32896)  #808080  fractal
60,62: (32896,32896,32896)  #808080  fractal
61,62: (32896,32896,32896)  #808080  fractal
62,62: (32896,32896,32896)  #808080  fractal
63,62: (32896,32896,32896)  #808080  fractal
64,62: (65535,32896,32896)  #FF8080  srgb(255,128,128)
65,62: (65535,32896,32896)  #FF8080  srgb(255,128,128)
66,62: (65535,32896,32896)  #FF8080  srgb(255,128,128)
I need output without name instead black output srgb(0,0,0)

please help me

Re: how I could convert image to text without output name of color ?

Posted: 2018-07-20T09:53:33-07:00
by fmw42
In place of txt: use sparse-color:

Code: Select all

convert image sparse-color:
Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown

Re: how I could convert image to text without output name of color ?

Posted: 2018-07-20T10:00:51-07:00
by diegomage
Version: ImageMagick 7.0.8-6 Q16 x86_64 2018-07-14 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC

OS lubuntu 14.04

HI this works but not have line break , how I could do with line break ?

Re: how I could convert image to text without output name of color ?

Posted: 2018-07-20T10:05:41-07:00
by fmw42
On unix, do

Code: Select all

convert image sparse-color: | tr " " "\n"

Re: how I could convert image to text without output name of color ?

Posted: 2018-07-20T10:11:37-07:00
by diegomage
very thank you