blurred image when resized
Monkey Forums/Monkey Programming/blurred image when resized
| ||
when i enlarge an image using drawimage, it gets blurred. is there a setting to avoid this? |
| ||
Make sure your image is originally an even number in width and height, like 512x128 and see if that helps. Not 512x123 (for example) I'm not sure which target you are using, but if you are using Floats to position and resize your image, you may want to cast the final position/size as Int() in your OnRender to see if that helps as well. I don't know why, but I also experienced blurriness in some images and this helped me. Otherwise, I'm not sure :( |
| ||
Oh, and whenever you "enlarge" an image anyway, it will probably blur because it has to make certain pixels larger - unless maybe you are starting with a much larger image, displaying it smaller, and then resizing it larger on the screen - tho it is still smaller than the original. If you are doing this, you would probably want all your resizes to resize from the original instead of the previously shrunken image. |
| ||
Turn off image-filtering: http://www.monkeycoder.co.nz/Community/posts.php?topic=993 Example: http://www.therevillsgames.com/monkey/Filtering/index.html |
| ||
Oh wow, that's amazing. All this hacking because I had no idea I needed to search for "image filtering". Ha. Thanks therevills - it helped me, hope it helps Yoda too. |
| ||
Whoa, nice one @therevills! I'd love to see that added officially. |
| ||
BTW. will turning off filtering speed up drawing on Android devices? |
| ||
anawiki - I just added this to my Android target build, and ran my game on my Galaxy Tab and it seemed to have no affect on the speed of drawing or the caching / stuttering problem. (At least on this one device) My graphics look WAY cleaner when scaled up this way, but the same old problems still exist otherwise. |
| ||
Well - actually, rendering the graphics this way seems to have gotten rid of those strange black lines of pixels below and to the right of my sprites. So, that's a massive plus for me. |