1

I've been running into some interesting behavior on Allegro 5 in regards to its bitmap library. Essentially, when I try to load either a bmp or png of the same image, that image goes through some sort of anti-aliasing or blur procedure by default that provides me with a distorted image. Is there any way to fix this issue so that I can render the image pixel for pixel?

screenshot

The image is a zoomed view of my allegro-rendered window to emphasize the artifacting, along with a little chrome window next to it showing what the image is supposed to look like. The first image is allegro loading a png, the second allegro loading a bitmap, and the third the proper source image in a chrome window that has been dragged next to the other images.

The code at this pastebin is pretty boiler-plate starting tutorial stuff for Allegro 5.

I've tried fiddling with allegro's display flags, and searched the web, and this site but couldn't find an answer. If the details matter, I'm using netbeans with the latest mingw and allegro 5.0.8.

Thank you for your time.

-Devin

Matthew
  • 47,584
  • 11
  • 86
  • 98
DevJRoc
  • 11
  • 1
  • Do you get the same behavior when using the OpenGL driver? Is it sharper if you draw at 0.5,0.5? – Matthew Feb 18 '13 at 05:22
  • [The offset results in worse artifacting](http://i.imgur.com/WYihiLY.png), although I should imagine this is expected behavior. Graphics drivers, on the other hand, which may be a bit beyond my current understanding, seem the likely the culprit. I went back and did some experimentation with other libraries I've fiddled with in the past, like XNA (C#) and PlayN (Java) and found similar effects. I'll do some research and poking around, but my initial impression is that drivers are related to the graphics card. If there's something else specific that you meant though, I'd love to be corrected. – DevJRoc Feb 18 '13 at 17:34
  • You can set ALLEGRO_OPENGL as a window option if you include the Allegro OpenGL header (allegro_opengl.h). By default, it will use D3D under windows. – Matthew Feb 18 '13 at 20:02
  • There're still artifacts here and there, but it's already much better than D3D's rendering. I'll see what else I can fiddle with in the given settings. I think this has sufficiently addressed my needs. Thank you for your assistance! – DevJRoc Feb 19 '13 at 05:47
  • If you want more info, you should ask at http://www.allegro.cc. My experience has always been drawing an image on a pixel edge produces the exact original, but I never use D3D or Windows. There may be some additional settings you can tweak. (Setting the ALLEGRO_MEMORY_BITMAP flag might work, but that would be dreadfully slow if drawn every frame.) – Matthew Feb 19 '13 at 06:27

0 Answers0