Image 1:
Image 2:
Both are simple shapes created in Photoshop and saved with the same settings.
Screenshot:
The oval barely has any jaggies, the stick (which has a pixel-perfect hard top and bottom) shows these little white atrocities. This isn't an exception, all hard-edged pngs have the same issue. What's up with that?
Just for the record, my graphics card is a 8800GTS with up to date drivers.
White jaggies when drawing rotated hard-edged images
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- DaedalusYoung
- Party member
- Posts: 413
- Joined: Sun Jul 14, 2013 8:04 pm
Re: White jaggies when drawing rotated hard-edged images
This is because the transparent area also has a colour. You just can't see it normally, because it is transparent, but when you rotate it, the alpha channel gets antialiased and the underlying colour shines through.
I'm not entirely sure how, but you should try making the transparent area the same colour as the rectangular shape (but with full alpha), then this issue won't occur.
To put it in numbers, the shape's colour may be something like (64, 0, 0, 255) in rgba, the transparent area now is (255, 255, 255, 0). Change the transparent bit to (64, 0, 0, 0) and you'll be fine.
I'm not entirely sure how, but you should try making the transparent area the same colour as the rectangular shape (but with full alpha), then this issue won't occur.
To put it in numbers, the shape's colour may be something like (64, 0, 0, 255) in rgba, the transparent area now is (255, 255, 255, 0). Change the transparent bit to (64, 0, 0, 0) and you'll be fine.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: White jaggies when drawing rotated hard-edged images
Let me prefix this by: I may be wrong.
But as far as I know, when images are rotated the pixels are blended with their neighbouring pixels to provide the right colour. Sadly, this goes wrong on the edges, because there are no neighbouring images, and the "synthesised" pixels are white. Simply adding a transparent border to your image should resolve this issue.
But as far as I know, when images are rotated the pixels are blended with their neighbouring pixels to provide the right colour. Sadly, this goes wrong on the edges, because there are no neighbouring images, and the "synthesised" pixels are white. Simply adding a transparent border to your image should resolve this issue.
Re: White jaggies when drawing rotated hard-edged images
The image already has some extra transparent space. Solid pixels on the edge of an image cause regular, hard jaggies.bartbes wrote:Let me prefix this by: I may be wrong.
But as far as I know, when images are rotated the pixels are blended with their neighbouring pixels to provide the right colour. Sadly, this goes wrong on the edges, because there are no neighbouring images, and the "synthesised" pixels are white. Simply adding a transparent border to your image should resolve this issue.
This seems to be correct! Adding a filled layer with 1% opacity in Photoshop changes the jaggies to any color I set the layer to. I suppose one way to solve this is to use some image manipulation library and modify all assets with a script, though it does feel a little quick and dirty. Thanks for the helpDaedalusYoung wrote:This is because the transparent area also has a colour. You just can't see it normally, because it is transparent, but when you rotate it, the alpha channel gets antialiased and the underlying colour shines through.
I'm not entirely sure how, but you should try making the transparent area the same colour as the rectangular shape (but with full alpha), then this issue won't occur.
To put it in numbers, the shape's colour may be something like (64, 0, 0, 255) in rgba, the transparent area now is (255, 255, 255, 0). Change the transparent bit to (64, 0, 0, 0) and you'll be fine.
Who is online
Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 3 guests