Page 1 of 1

from top, trim to first white horizontal line,from bottom, trim to first black horizontal line

Posted: 2018-01-19T12:12:31-07:00
by picmogic
Now I would like to remove/delete the rest colors, something like -trim of all non-white and non-black colors. What is the elegant way of doing it? Thanks in advance.

Background: The images I have are simply screenshots of .txt files in eaglemode, so I would like to keep only the "text containing" area, removing rest. What I am doing is, sorting the lines by length, then want to get this line shapes, simply as black field, against white. Those shapes I want to use as masks for other purposes. Thanks a lot.

UPDATE:
More precise description of the problem would be:
-from top, trim up to first white horizontal line
-from bottom, trim up to first black horizontal line

Re: Having black text on white background plus rest colors

Posted: 2018-01-19T12:27:01-07:00
by fmw42
Please always provide your IM version and platform. Also post an example image to some free hosting service that won't change your image format (such as dropbox.com) and put the URL here, so that we can see exactly what you are trying to do.

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

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/

Re: Having black text on white background plus rest colors

Posted: 2018-01-19T12:43:51-07:00
by picmogic
convert --version
Version: ImageMagick 6.7.7-10 2017-07-31 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

ubuntu 14.04 LTS

Re: Having black text on white background plus rest colors

Posted: 2018-01-19T12:47:18-07:00
by picmogic
Imagine any of those text files, but just zoomed in to a single one. So you have this blueish surrounding around the white text field. I would like to keep only this box, as a first step to my story above.
http://eaglemode.sourceforge.net/screenshots/em_b02.jpg