Rotated images are Fuzzy

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
EvilSheepLord
Prole
Posts: 10
Joined: Wed Jun 05, 2013 6:05 pm

Rotated images are Fuzzy

Post by EvilSheepLord »

Hi All,

I just stumbled across this little engine the other day and I have started playing around with it. I apologize in advance if this has been asked, I did search the topics and couldn't find anything relative.

Using love.graphics.draw(ImageObject,x,y, math.rad(45)) produces are very fuzzy image, whereas love.graphics.draw(ImageObject,x,y, math.rad(90)) produces are nice clean image.

The image I am using is a 32x32 png file.

It seems like a bug in the draw the rotation code. Is there any way to achieve clean rotated images without needing an image for every rotation?

Thanks!
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Rotated images are Fuzzy

Post by Plu »

You could try setting the filtermode on the image, although I'm not sure if it's used for rotating as well.

http://love2d.org/wiki/(Image):setFilter

You'd need to set it to 'nearest'.

If that doesn't work, you'll have to wait for one of the more experienced guys to show up :P
EvilSheepLord
Prole
Posts: 10
Joined: Wed Jun 05, 2013 6:05 pm

Re: Rotated images are Fuzzy

Post by EvilSheepLord »

I will give that a try and see if it helps. I'll post my findings.

Thanks!
EvilSheepLord
Prole
Posts: 10
Joined: Wed Jun 05, 2013 6:05 pm

Re: Rotated images are Fuzzy

Post by EvilSheepLord »

I tried the setFilter method. setFilter("nearest","nearest") took the outside fuzz away but it distorted the colors inside the image.
It almost looks as if the rotated image on a non N,S,W,E direction is being anti-aliased.
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Rotated images are Fuzzy

Post by Boolsheet »

Can you post the code and the image and then tell us what you see and what you were expecting?
Shallow indentations.
EvilSheepLord
Prole
Posts: 10
Joined: Wed Jun 05, 2013 6:05 pm

Re: Rotated images are Fuzzy

Post by EvilSheepLord »

The code is in my original post. It's two lines of code. If you use that code and load an image it won't look clean when it is rotated. This should be very easy to reproduce. My exact code is a little convoluted as I have positions stored on an object. None of this is relevant however as the issue is with the draw function and not my image or the preceding code. This is proven by rotating the image at 90 and 45 and getting varying results in the visual impact of the image.
EvilSheepLord
Prole
Posts: 10
Joined: Wed Jun 05, 2013 6:05 pm

Re: Rotated images are Fuzzy

Post by EvilSheepLord »

Ok. This is interesting. I tried a different image and it looks correct. It must be something to do with the image itself that causes the distortion.
This post can be ignored for now :P
User avatar
Boolsheet
Inner party member
Posts: 780
Joined: Wed Dec 29, 2010 4:57 am
Location: Switzerland

Re: Rotated images are Fuzzy

Post by Boolsheet »

EvilSheepLord wrote:It must be something to do with the image itself that causes the distortion.
That's why I specifically asked for the image. The whole graphics pipeline has a lot of details and can have certain effects on special data. Some of them may be outside of your expectations and look "wrong".
Shallow indentations.
EvilSheepLord
Prole
Posts: 10
Joined: Wed Jun 05, 2013 6:05 pm

Re: Rotated images are Fuzzy

Post by EvilSheepLord »

Boolsheet wrote:
EvilSheepLord wrote:It must be something to do with the image itself that causes the distortion.
That's why I specifically asked for the image. The whole graphics pipeline has a lot of details and can have certain effects on special data. Some of them may be outside of your expectations and look "wrong".
Gotcha. It was a spaceship I found online that I was using to try out the engine. When I get a chance I will post a link to the image I was using.

Thanks!
User avatar
substitute541
Party member
Posts: 484
Joined: Fri Aug 24, 2012 9:04 am
Location: Southern Leyte, Visayas, Philippines
Contact:

Re: Rotated images are Fuzzy

Post by substitute541 »

It isn't a bug, it's rather a limitation in the filters. If you rotate any image in a graphics program, it will look fuzzy (unless that graphics program has a super-awesome filter we don't know about >_>*.) Same is true for scaling images. To fix this, either use a higher resolution image and scale it down, or use separate images for each rotation.

Edit: *or if the image you are rotating is a high resolution image.
Currently designing themes for WordPress.

Sometimes lurks around the forum.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 197 guests