Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #228675

Re: color border in image, drop everything outside of it

From Jeremy Ardley <jeremy@ardley.org>
Newsgroups linux.debian.user
Subject Re: color border in image, drop everything outside of it
Date 2020-11-15 12:00 +0100
Message-ID <BbnVf-5AD-1@gated-at.bofh.it> (permalink)
References <Bbdjb-7Ih-7@gated-at.bofh.it> <BbmFP-4Uy-9@gated-at.bofh.it> <Bbnsd-5qg-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 15/11/20 6:27 pm, The Wanderer wrote:
> On 2020-11-15 at 04:38, tomas@tuxteam.de wrote:
>
>> On Sun, Nov 15, 2020 at 12:31:22AM +0100, Emanuel Berg wrote:
>>
>>> Hello, is there a tool/command/script anywhere that can overwrite
>>> with a single color (or make transparent) every pixel to the left,
>>> above, right, and below a certain other color?
>>>
>>> e.g., if one draws a loop of black, tell the program black is the
>>> border, the result would be only what is within the loop?
>> Your request is a bit... unspecific.
>>
>> Are you (a) after a tool which you use interactively, where you
>> actually see the image you described above, and where you can click
>> into that loop to start the operation?
>>
>> Or is it (b) rather some kind or "batch mode", where you give the
>> program the image file *plus* the coordinates of that point inside
>> the loop where to start?
>>
>> For ease of search, the operation you're describing is usually called
>> "flood fill". If you are after (a), your friend is The Gimp; I guess
>> Krita will fill that bill as well. If it's (b), the usual standard is
>> "mogrify", from the ImageMagick suite. Look at [1] for the details on
>> flood fill.
> I think you may have misunderstood the request - either that, or I did.
>
>  From the description of "flood fill", what it does is replace everything
> within a certain distance of a specified point with a specified color.
> That maps to "fill a specified region with a specified color", if the
> region is radius-based.
>
> What I understand the request to be is for a way to replace everything
> *outside of* a specified region with a specified color, where the region
> is *not* necessarily radius-based but may potentially be freeform.
>
> If I needed to do that, what I'd probably wind up doing is to select the
> desired region, copy it, paste it into an empty image, and adjust its
> position and the size of the image to suit. I don't know of any tool to
> automate the process to any meaningful degree.


The requirement seems to be to infill an image inside a bounding line.

This is what happens in postscript rendering when a raster algorithm 
scans a page containing a path defined by some geometry e.g. Bezler 
curve, and every time it crosses the curve on a scan line it changes 
from writing nothing to writing the infill color and back again at the 
next curve intersection

This happens on every character on every page you print on a postscript 
printer. It's a really basic image algorithm.

If it's possible from a script I'm not sure? but it's so simple it's 
very likely


Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-15 00:40 +0100
  Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 10:00 +0100
    Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-15 10:10 +0100
      Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 11:10 +0100
        Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 11:30 +0100
        Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 03:30 +0100
  Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 10:40 +0100
    Re: color border in image, drop everything outside of it The Wanderer <wanderer@fastmail.fm> - 2020-11-15 11:30 +0100
      Re: color border in image, drop everything outside of it Jeremy Ardley <jeremy@ardley.org> - 2020-11-15 12:00 +0100
      Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 12:10 +0100
        Re: color border in image, drop everything outside of it The Wanderer <wanderer@fastmail.fm> - 2020-11-15 12:50 +0100
          Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-15 13:30 +0100
      Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 12:10 +0100
        Re: color border in image, drop everything outside of it Michael uplawski <linux-gate@don.blech.e4ward.com> - 2020-11-15 12:50 +0100
      Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 03:20 +0100
    Re: color border in image, drop everything outside of it mick crane <mick.crane@gmail.com> - 2020-11-15 11:40 +0100
    Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 03:20 +0100
      Re: color border in image, drop everything outside of it David Wright <deblis@lionunicorn.co.uk> - 2020-11-22 04:40 +0100
        Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 05:20 +0100
          Re: color border in image, drop everything outside of it David Wright <deblis@lionunicorn.co.uk> - 2020-11-23 06:20 +0100
            Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-23 06:30 +0100
              Re: color border in image, drop everything outside of it David Wright <deblis@lionunicorn.co.uk> - 2020-11-24 20:50 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-24 22:40 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-24 22:50 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-26 01:30 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-26 09:50 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-26 12:30 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-26 12:40 +0100
                Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-26 12:50 +0100
                Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-26 14:10 +0100
      Re: color border in image, drop everything outside of it <tomas@tuxteam.de> - 2020-11-22 10:10 +0100
        Re: color border in image, drop everything outside of it Emanuel Berg <moasenwood@zoho.eu> - 2020-11-22 10:30 +0100

csiph-web