Search found 4 matches

by Jörn
2013-09-19T07:10:01-07:00
Forum: Users
Topic: Select largest connected nonwhite area
Replies: 12
Views: 3472

Re: Select largest connected nonwhite area

You can test if the center is not white. If it is search some number of pixels up, down, left, and right. You can iterate the distance until you find a non-white point near the center. It is probably not the smartest way of doing it but it works very well: #!/usr/bin/perl my $file = "original.png ...
by Jörn
2013-09-18T13:51:23-07:00
Forum: Users
Topic: Select largest connected nonwhite area
Replies: 12
Views: 3472

Re: Select largest connected nonwhite area

If you can identify some point in the largest region, then this will work and is much simpler coords="260,260" # first line: read original and create a fully white image the same size # second line: clone the input and replace everything that is not white with black # third line: floodfill the ...
by Jörn
2013-09-18T13:42:09-07:00
Forum: Users
Topic: Select largest connected nonwhite area
Replies: 12
Views: 3472

Re: Select largest connected nonwhite area

We can find a point in the largest area with morphology, though it uses an unusual definition of "largest": the area with a pixel furthest from any of its edges. Windows script: Thanks so much for the fast answer. I should have told you that I'm using version 6.5.4 on linux. My customer probably ...
by Jörn
2013-09-18T11:17:04-07:00
Forum: Users
Topic: Select largest connected nonwhite area
Replies: 12
Views: 3472

Select largest connected nonwhite area

Hello, I would like to use IM (or gimp) in batch mode to process an png file in the following way: - select the largest nonwhite area - create an rectangle which contains this area and crop to it - add a border around (I know how to do this step :-) ) http://www.beilke-cfd.de/original.png http://www ...