Search found 18 matches

by nicolai.rostov
2016-10-01T17:48:47-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

Re: How to dilate foregrouned only if it's surrounded by background?

Yep, black and white, at least this is how the documentation makes me see what morphology (originally) sees as background and foreground. On the other hand, doesn't IM already have a similar feature? How does the '-despeckle' operator decide what is, and what is not, a speckle? There must be a way ...
by nicolai.rostov
2016-10-01T17:35:43-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

Re: How to dilate foreground only if it's surrounded by background?

You're right. I still don't fully understand how morphology, and especially the kernels, work. But, as you said, if it "looks at all the pixels in a region around each pixel in the image to decide what to do", I wonder if it could, by looking at those same pixels, decide not just what to do but also ...
by nicolai.rostov
2016-10-01T11:37:55-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

Re: How to dilate foreground only if it's surrounded by background?

Thanks for having checked IM 7 for me. I'm using ImageMagick 6.7.7-10, Linux, (see bottom of message #4 above). I see your point. Boundary black pixels are affected by a morphology process that is triggered by white pixels covered by a mask that only protects them for writing. Is it not possible to ...
by nicolai.rostov
2016-10-01T11:18:57-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

Re: How to dilate foreground only if it's surrounded by background?

Okay, you win. :D In order to make your code shorter, it's safe to drop

Code: Select all

-fuzz 90%
and

Code: Select all

-alpha off
when working with 1-bit, black and white, images, isn't it?
by nicolai.rostov
2016-10-01T08:58:46-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

Re: How to dilate foreground only if it's surrounded by background?

Okay, I think I got it. The trick perhaps is to use the original image as its own mask! convert pixel.gif -mask pixel.gif -morphology dilate diamond +mask show: http://i.imgur.com/HXQfWQ7.gif But this doesn't work for diamond:2, though. :( convert pixel.gif -mask pixel.gif -morphology dilate diamond ...
by nicolai.rostov
2016-10-01T07:39:02-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

Re: How to dilate foreground only if it's surrounded by background?

Thanks again. Using floodfill and compose works pretty well but it turns out, however, to be a bit expensive for dilating smaller, say, 1 to 3-pixel wide foreground points in images having many such white points. Could you teach me how to define a morphology kernel that operates on such 1 to 3 pixel ...
by nicolai.rostov
2016-09-30T14:20:57-07:00
Forum: Users
Topic: How to dilate foreground only if it's surrounded by background?
Replies: 16
Views: 7213

How to dilate foreground only if it's surrounded by background?

How can I use the morphology operator to (i) enlarge an internal foreground (white) disk without (ii) shrinking the enclosing background (black) circle? http://i.imgur.com/gVQPZlP.png With the dilate method I am able to enlarge the internal disk. convert input.pbm -morphology dilate disk:10 show ...
by nicolai.rostov
2016-01-27T22:45:41-07:00
Forum: Users
Topic: How to change the default show: viewer?
Replies: 7
Views: 4488

Re: How to change the default show: viewer?

Also, it seems we need to comment out the "miff" XML element as well. If input is a PBM file, then output still goes to IM's display. Don't ask me why. :? <!--delegate decode="miff" encode="show" spawn="True" command=""/usr/bin/display" -delay 0 -window-group %[group] -title "%l " "ephemeral:%i ...
by nicolai.rostov
2016-01-27T22:07:42-07:00
Forum: Users
Topic: How to change the default show: viewer?
Replies: 7
Views: 4488

Re: How to change the default show: viewer?

Excellent. The method does indeed work. Thanks. :) There is, however, a typo in your code that prevents it from working as it is. We need to insert a slash at the end of the XML element. Otherwise the output will be written to a file named "show:", not delegated to a viewer. It should be as follows ...
by nicolai.rostov
2016-01-27T21:02:58-07:00
Forum: Users
Topic: How to change the default show: viewer?
Replies: 7
Views: 4488

Re: How to change the default show: viewer?

Thank you both. :) My /etc/ImageMagick/delegates.xml lacks such a line, though (ImageMagick 6.7.7-10). At any rate, I guess this hack would work only for PNG files but not generally, that is, not for any other format whatever. I found out that merely replacing the executable /usr/bin/display with ...
by nicolai.rostov
2016-01-27T18:23:46-07:00
Forum: Users
Topic: How to change the default show: viewer?
Replies: 7
Views: 4488

How to change the default show: viewer?

How can I use a viewer other than IM's native display when using show: as the output of the command-line tool convert? For example, suppose that I want to preview in ExactImage's edisplay an image generated by ImageMagick's convert: $ convert input.png -trim output.png $ edisplay output.png Is it ...
by nicolai.rostov
2015-11-14T05:39:42-07:00
Forum: Users
Topic: How to unwarp a page gutter?
Replies: 6
Views: 4569

Re: How to unwarp a page gutter?

I see. But is there any way to apply a pincushion distortion only to the right side of an image, though? Or maybe I could rotate the original so that the current distortion axis (white-gray boundary above) goes to the center of the image, and then apply a pincushion distortion to that, crop the ...
by nicolai.rostov
2015-11-13T14:10:29-07:00
Forum: Users
Topic: How to unwarp a page gutter?
Replies: 6
Views: 4569

Re: How to unwarp a page gutter?

Thanks. Is it possible to apply an (inverted) IM's barrel distortion method diagonally? All examples on that page are distorted around a vertical or horizontal axis in the middle of the image.
by nicolai.rostov
2015-11-13T13:43:05-07:00
Forum: Users
Topic: How to unwarp a page gutter?
Replies: 6
Views: 4569

Re: How to unwarp a page gutter?

Okay. I'm trying to understand how Fred's pinbarrel works but am clueless as to how to calculate the right radial distortion/correction coefficients. There is an example on Fred's homepage to make a square into an image which is distorted in a way that looks like my page above. I'd like to build ...