Mask Trouble

I had my mask working fine until…

I needed to change the size of my images including the one being masked. I made all of my images including the mask larger in Photoshop and using the display.newImageRect I changed the width and height of them all. Now my mask shows up distorted. As a test, I saved my mask as the letter “T” shape. It showed on screen skewed and possibly rotated as well. Just the mask, no other image. I tried a new mask (a rectangle) and that one was skewed and had a gap in it. I cannot figure out what’s happening. [import]uid: 22392 topic_id: 6168 reply_id: 306168[/import]

I’m having the same problem. For some reason I can’t seem to save the correct “flavor” of png file that that sample mask png’s are in. Any tips? [import]uid: 40000 topic_id: 6168 reply_id: 25401[/import]

OK - I’ve done some research through trial and error. The bottom line seems to be that the width and height of the mask image cannot be greater than 200. Also - the height cannot be greater than the width. It doesn’t matter if the image is square, indexed, RGB, greyscale or anything else that I can find.

I’m guessing this is a bug. Can someone from Corona support confirm? [import]uid: 40000 topic_id: 6168 reply_id: 25406[/import]

That’s interesting, I’ll have to check that myself.

I actually had to use the png image from the Corona sample app as my mask because I never did figure out how to fix my problem. Every image I made was skewed beyond use. I wonder if anyone from Support has looked into this yet. [import]uid: 22392 topic_id: 6168 reply_id: 25439[/import]

I’m seeing this same issue. My masks all end up being skewed or something. The suggested 200 pixel maximum doesn’t seem to be true in my case, though. I’m seeing the distortion with a mask that is 134x59. [import]uid: 38950 topic_id: 6168 reply_id: 26477[/import]

Is that 134 wide or high? I was finding that the height couldn’t exceed the width as an additional constraint. Sound like it’s probably an easy bug to fix at the source … [import]uid: 40000 topic_id: 6168 reply_id: 26510[/import]

Wide. I was able to get it working, finally, but I don’t know exactly what made it work. It seems to depend on the size of the mask AND the size of the object being masked, though, because I could get the 134x59 mask to work on a differently sized image.

I’m sticking with a mask that’s 256x256. I’m sure I could get it smaller, but I’m burned out after messing with so many combinations that didn’t work. [import]uid: 38950 topic_id: 6168 reply_id: 26513[/import]

I was getting skewed results for masks as well. I guess I should have reported a bug, but I was able to work around the issue by using a mask png that was somewhat larger than the object being masked. [import]uid: 27183 topic_id: 6168 reply_id: 27333[/import]

are you scaling the images you are masking (with code, not photoshop etc). that will scale the mask too from what i remember [import]uid: 6645 topic_id: 6168 reply_id: 27585[/import]

The problem is skewing, which can’t be explained by a mask that is scaled incorrectly. [import]uid: 38950 topic_id: 6168 reply_id: 27590[/import]

For me it is the mask that is skewed, not the object [import]uid: 22392 topic_id: 6168 reply_id: 27665[/import]

Mask is skewed here too. I am using >300 px assets.

Anyone knows how to resolve this bug? [import]uid: 7356 topic_id: 6168 reply_id: 30527[/import]

Can you try remaking the mask so it has some padding around the edges? Say your object is 100x50, try making a mask that’s 108x58 to give it 4 pixel padding. Maybe more if that doesn’t work. [import]uid: 27183 topic_id: 6168 reply_id: 30529[/import]

I tried it with a +5% size for the mask but nothing happens.

Actually, I think the mask is always scaled down to the image size. [import]uid: 7356 topic_id: 6168 reply_id: 30531[/import]

Hi guys, I have the same problem.
My mask works fine if I use the same size of the X-ray example but if I change the size, the mask gets skewed.
I’ve tried different saving options for the png, different sizes for both the display object and the mask image, I left a lot of black space on the border of the mask, but nothing seems to fix the issue.
Any news about that? Suggestions? [import]uid: 47531 topic_id: 6168 reply_id: 30678[/import]

What I conclude from this (and other threads):

  1. Ansca releases features without any serious testing.

  2. Users immediately do some alpha testing and report the bugs in the “Bugs Report” section of the forum, but most of the times no one at Ansca reads about those bugs. Even the Bugs DB is not working as it should.

  3. Some bug-threads are getting bigger and bigger until someone at Ansca reads them by luck/accident. He then “tracks” the bug.

  4. Tracked bugs remain tracked for months (2+) until someone starts being rude/offensive/negative.
    Something is going wrong here…
    [import]uid: 7356 topic_id: 6168 reply_id: 30686[/import]

I got my mask to work by adding enough black border to make each edge a power of two. With an image that’s 24x45, for instance, the mask would be 32x64. That said, it may have been a coincidence. [import]uid: 38950 topic_id: 6168 reply_id: 30687[/import]

Thank you very much, this worked also for me.
The odd thing is that the mask size in the examples is not based on powers of 2 (200x200). [import]uid: 47531 topic_id: 6168 reply_id: 30688[/import]

I just created a masking sample where I created two display objects one a rect the other an image. And I tried a variety of mask sizes larger than the target and smaller also with and without gradients and tested it on build 336.

The masking looks correct except for 1 sample where the mask was a circle that inscribed the mask. The edges of the circle look like they’re bleeding.

http://screencast.com/t/0Qv3WbOVLkcJ

http://screencast.com/t/NZTEsRSV

Just did another sample based of josh6’s reply. Looks like odd dimensions causes skewing.
http://screencast.com/t/DGoZzRHQ2D [import]uid: 27183 topic_id: 6168 reply_id: 30689[/import]

Hmm looks like it’s not just odd dimensions. I’m getting skewed results on a 302x302, 301x200, 301x201, but not 300x201.

Will do more tests and report back. [import]uid: 27183 topic_id: 6168 reply_id: 30692[/import]