Problem with gaphics.newOutline

Gang, 

   I have been using graphics.newOutline for a while and it has been working great.  However, I have been stumped because for this one rock it refuses to outline it.  I have recently discovered Blender and created a 3D rock for my game and saved it as an RGBa 8 bit png file.  Threw that into photoshop and cropped it and saved it again with a transparent background as an RGB 8 /bit png file.  When I load it with this: 

self.imageoutline = graphics.newOutline (2,imagefile)

it just wont outline the rock properly.  I have tried many things over the past couple days.  Too many to mention really.  If you can see my screen shot above it just gets pieces of it.  Varying the number helps but doesn’t actually fix the problem.  It seems to have problems with this round image.  I tried making a simple circle and it seemed to have problems with that as well.  When I make 2 of the edges straight it seems to work.  I was wondering if the program has problems with circles but that doesn’t make sense because my round fish seem to outline OK.   

   If someone could help that would be great.  I would like to add lots of these rocks in varying sized and I don’t really have time to hand vector them all.  

Thanks,  Sweet

Can you link the actual image you’re using so we can download it and experiment with it?  This will help us figure it out.

Thanks,

Ed

https://onedrive.live.com/redir?resid=83E26FE6513E1D76!10807&authkey=!AOWEQVEnBN8zALU&ithint=file%2cpng

See if that link works for you.   However,  I noticed that corona has problems with circles.  Doesn’t seem to matter if it is rock or not.  I just tried creating a plain circle in gimp and photoshop and got the same result.  If I draw a very irregular image it seems to work just fine.   

At first glance, you need more border around that image.  The color is dithering to the very edge.

Experimenting now.

Well, it seems the shape is just too complex for the outline algorithm to cope with it.

I was able to get a fairly decent outline with this setting though:

self.imageoutline = graphics.newOutline (15,imagefile)

[sharedmedia=core:attachments:4277]

 
First thanks for helping.  I have been playing with this for 2 days with no results.  It is hard to work on a game when you get stuck on the simple stuff!  
 
It is my understanding that the algorithm works on the alpha channel not the image.   So the red green and blue rock should not be making any difference.  Now PNG doesn’t actually have an alpha channel so I am not sure what is really going on here.   Maybe some doc that says just how to build out a black and white alpha channel and the format to use would be greatly appreciated.  
 
I created a simple round circle and tried it in the game with the same result.   Please see the circle.png file I uploaded.  I have tried numbers between 1 and 400 for the coarsenessInTexels numbers and none of them work.  The doc doesn’t say the ranges for the number so I am just guessing around, very frustrating.  

I am a bit surprised that there are no other forum entries on this problem since it seems like it would be a common one most people would hit.  

In any case, if there is anyone out there that has figured out a work around please share.  

Sweet

Well, I can’t speak for others, but I never use this feature.  I always hand-tune my bodies or use simplified bodies like rectangles and spheres.  However, in your case I see how that would not fit.

You might consider using a tool to generate body specs instead:

https://www.codeandweb.com/physicseditor

(PS - Looks like they have a free Trial; so you can give it a shot at no cost.)

Ah, codeandweb.  I tied that last year.   It will probably work.   But this little line of code is just so easy, if it would just work!   Just a tease I guess.  

Can you link the actual image you’re using so we can download it and experiment with it?  This will help us figure it out.

Thanks,

Ed

https://onedrive.live.com/redir?resid=83E26FE6513E1D76!10807&authkey=!AOWEQVEnBN8zALU&ithint=file%2cpng

See if that link works for you.   However,  I noticed that corona has problems with circles.  Doesn’t seem to matter if it is rock or not.  I just tried creating a plain circle in gimp and photoshop and got the same result.  If I draw a very irregular image it seems to work just fine.   

At first glance, you need more border around that image.  The color is dithering to the very edge.

Experimenting now.

Well, it seems the shape is just too complex for the outline algorithm to cope with it.

I was able to get a fairly decent outline with this setting though:

self.imageoutline = graphics.newOutline (15,imagefile)

[sharedmedia=core:attachments:4277]

 
First thanks for helping.  I have been playing with this for 2 days with no results.  It is hard to work on a game when you get stuck on the simple stuff!  
 
It is my understanding that the algorithm works on the alpha channel not the image.   So the red green and blue rock should not be making any difference.  Now PNG doesn’t actually have an alpha channel so I am not sure what is really going on here.   Maybe some doc that says just how to build out a black and white alpha channel and the format to use would be greatly appreciated.  
 
I created a simple round circle and tried it in the game with the same result.   Please see the circle.png file I uploaded.  I have tried numbers between 1 and 400 for the coarsenessInTexels numbers and none of them work.  The doc doesn’t say the ranges for the number so I am just guessing around, very frustrating.  

I am a bit surprised that there are no other forum entries on this problem since it seems like it would be a common one most people would hit.  

In any case, if there is anyone out there that has figured out a work around please share.  

Sweet

Well, I can’t speak for others, but I never use this feature.  I always hand-tune my bodies or use simplified bodies like rectangles and spheres.  However, in your case I see how that would not fit.

You might consider using a tool to generate body specs instead:

https://www.codeandweb.com/physicseditor

(PS - Looks like they have a free Trial; so you can give it a shot at no cost.)

Ah, codeandweb.  I tied that last year.   It will probably work.   But this little line of code is just so easy, if it would just work!   Just a tease I guess.