Log in

View Full Version : Fully expand mask horizontally?


kentaru
20th March 2010, 23:24
Is there a way to expand a binary mask horizontally, such that any dot in the mask becomes a solid horizontal line?

I've tried mt_expand with custom parameters, but couldn't get the mask to fill out the full width of the frame. Any help would be appreciated, Thanks.

wonkey_monkey
20th March 2010, 23:39
You could do multiple* horizontal resizes/thresholds until you get down to 1 pixel, then resize back up to full width?

* you don't want to resize down to less than, say, 1/100th of the width in one go, in order to avoid losing any masked pixels to rounding errors.

David

AVIL
21st March 2010, 13:08
Hi:

To make expansions multiples of two (2, 4, 8, ...) you can use pointresize.

Gived that your clip mask is named clip, and has widht = W and height = H

If you need to duplicate pixels horizontally try

clip.Pointresize(2*W , H)

if cuadruplicate :

clip.Pointresize(2*W , H).Pointresize(4*W , H)

.....