Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Sprites scale problem (Green edge)  (Read 5745 times)

0 Members and 1 Guest are viewing this topic.

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Sprites scale problem (Green edge)
« on: November 28, 2007, 04:02:44 PM »

Hi!

I'm a problem with the sprite scale.

If the sprite is to 100 % on a large scale, everything works perfectly. But if WME reduces the personage, making it smaller, a troublesome green edge appears in the reduced sprite. The color of the edge is the color of the transparent color of the PNG file. And if I change the color of the transparent color, the color of the edge also changes.

I'm add a image to see the problem.




Thanks!!!
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #1 on: November 28, 2007, 04:10:48 PM »

This method will always leave some "garbage" at the edges since it doesn't offer antialized sprites. Since you are using png I suggest to create one with alpha channel.
Logged
fl*p

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Sprites scale problem (Green edge)
« Reply #2 on: November 28, 2007, 04:21:32 PM »

Yes, using the alpha channel should effectively fix this problem.
However it shouldn't happen, and it's likely you'll get rid of it by installing a newer video driver.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #3 on: November 28, 2007, 07:26:01 PM »

It is not a problem of the software?
I have proved the game in several computers and the result always is the same: green edge in scaled sprites.

To nobody more this happens? It is curious.

This it is one of the sprites that I have used to test. I have not managed to apply a channel alpha to the file PNG. The transparency is defined by a color of transparent background.



Please I need help!!!!  Thanks.
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #4 on: November 28, 2007, 07:41:44 PM »

Are you using this *exact* png that you have posted or you are applying a background to it before putting it into the game?
Logged
fl*p

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #5 on: November 28, 2007, 08:03:30 PM »

Yes. The sprite on this post are the original of the image:



Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #6 on: November 28, 2007, 08:08:10 PM »

I'm confused  ??? You said that "The color of the edge is the color of the transparent color of the PNG file. And if I change the color of the transparent color, the color of the edge also changes." Where is that color (green in this case) you are talking about?
Logged
fl*p

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #7 on: November 28, 2007, 08:16:25 PM »

Which program are you using to create this file?
Logged
fl*p

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #8 on: November 29, 2007, 12:29:04 AM »

The green color is the background color, the transparent layer.

This files making in Cosmigo Promotion 5.

Thanks
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #9 on: November 29, 2007, 12:48:35 AM »

Hm... that's a program I've never heard before. It must be doing something strange with the file. It's a png file with custom palette (indexed) with transparency. It's working fine in most programs but wme & some other programs are reading it in a strange way.
Can you please try this file http://master.math.upatras.gr/~odnorf/misc_images/test.png
and tell me if it fixes the problem?
« Last Edit: November 29, 2007, 12:54:45 AM by odnorf »
Logged
fl*p

Jyujinkai

  • Global Moderator
  • Frequent poster
  • *
  • Karma: 1
  • Offline Offline
  • Posts: 352
    • View Profile
    • Jyujinkai's WME Development Blog
Re: Sprites scale problem (Green edge)
« Reply #10 on: November 29, 2007, 01:16:27 AM »

the alpha can on bmps need to be an exact colour match for the transparency to work. When you get pink or green edges around teh outline of the opaque part of the image it is normaly caused by the pixels on that edge not being a true colour match.... say you are using 0,255,0 the edge pixels might be 0,254.0 and thus are not showing up as transparent in the engine.

You can use PNG files to have true colour gradients on your alpha... i can not remember of the top of my head but there are some circumstances when even this dosn't work and you have to use hard edge transitions.

I use photoshop to make exact colour alphas. so i can give you a way to do that.....

1) Put the cutout on a new layer
2) fill the background layer with your transparent colour
3) on your cut out layer go "select/load selection/ layer transparency" (or ctr+click on layer)
4) Click "edit in quick mode" (the button is on the tool bar)  - - (or press Q)
4) Go "image/adjustmets/threshold" and move slider to 255
5) turn off quick edit mode.

You now have a selection on the cut out layer that is pixle perfect with no semi transparent pixles selected

6) invert the selection of the cut out layer
7) Delete the selection .. (delete all pixles that are semi transparent)

You now have a cut out layer that is true pixle perfect... everything outside the cut out is 100% your alpha colour.


Hope this helps


still i would use a png file and have a proper alpha channel in it instead of a colour transparency ... that way you can have true colour gradients on your alpha.. they look a lot better

« Last Edit: November 29, 2007, 01:20:39 AM by Jyujinkai »
Logged
<Antoine de Saint-Exupéry> In any thing at all, perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away...
<Carl Sagan> If you want to make a apple pie from scratch. You must first... invent the universe

Maidnet

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 50
    • View Profile
Re: Sprites scale problem (Green edge)
« Reply #11 on: November 30, 2007, 09:29:05 AM »

I believe that already I have solved the problem.

I have eliminated the transparency that was assigning the program PROMOTION, and I have saved PNG with solid background, with 256 colours palette, and have given him the transparency directly in spriteedit. I have to verify it better, but I believe that it eliminates the problem.

Thank you very much for the help. I expect to show you soon the results of so many work!
Logged
 

Page created in 0.047 seconds with 24 queries.