Fuzzy images

BlitzMax Forums/BlitzMax Beginners Area/Fuzzy images

rockford(Posted 2007) [#1]
I'm creating a simple point&click game in Max for the mini-comp over at www.retroremakes.com and I'm finding that some of my sprites present as being fuzzy/interpolated. I can understand that, but some other sprites/images are fine.



If you look at the gas attendant, spanner and Reaper you'll see the interpolation, whereas the petrol pump and warning poster are both clean and free from it - despite all being separate images.

I didn't notice any problems with another game, but as this one uses a limited palette, it's quite obvious.

Is it possible to set up the screen so all images are crisp and clear? The background is clean too, as is the writing and item boxes.

I've tried using SetGraphicsDriver to various settings and didn't see any obvious difference in appearance.


tonyg(Posted 2007) [#2]
What options are you using when loading your images?
What format are they saved in?
What size are the textures?
What screen parms have you used?
How are you positioning the images (float or int)?
What if you simply load one of the images and display it on the screen? If you get the problem then post the source and the image and we can try ourselves.


rockford(Posted 2007) [#3]
Sorry, I should have given more info.

I'm using BMax on pc.

I'm using .BMP format for images - no other - there are no transparent areas required. Images are all masked in the same way RGB 255,0,255 and I use SetMaskColor(255,0,255) - I haven't tried alternative colours for the mask.

Screen res. 800x600 - fullscreen (although this makes no difference, as I've changed resolution and Windowed mode to test and get the same results.

Textures/images are various sizes and I've used multiples of 2. Made no difference.

Image positioning is all INT based.

I've not tried individual image drawing tbh. I'll do that a bit later.


Dreamora(Posted 2007) [#4]
using PNG and Alpha on them helps smoothing the images, especially when rotated.

But you can play with the image loading flags (filteredImage and mipmappedimage) to see if it makes a difference.


rockford(Posted 2007) [#5]
Changing the loading flags to 1 helped - still not perfect, but much better than it was. I forgot about the extra parameter. BTW 0 was perfect, but showed the imagemask.

Also, .PNGs are larger than .BMPs when zipped and I don't need the alpha or rotation, so that's why I use plain old vanilla flavour BMPs. :)

Thanks Dreamora


Gabriel(Posted 2007) [#6]

Textures/images are various sizes and I've used multiples of 2. Made no difference.

Powers of 2, not multiples of 2.


JazzieB(Posted 2007) [#7]
Also, .PNGs are larger than .BMPs when zipped and I don't need the alpha or rotation, so that's why I use plain old vanilla flavour BMPs. :)


Slightly off-topic, but what about the amount of disk space BMPs take up compared to PNGs? I think people would prefer to have the final game/app take less space on their hard drive than have the one time download take a little bit longer.


rockford(Posted 2007) [#8]
It eases my bandwidth. If the user chooses to download my game, then that's their problem ;) :P Besides, it's unlikely to remain on anyone's HD for long...

And I meant powers of 2 too. :)


Czar Flavius(Posted 2007) [#9]
Use WinRAR Solid Archive!


rockford(Posted 2007) [#10]
I do actually use WinRAR - not sure about SolidArchive... I just used "zipped" as a generic term.


Czar Flavius(Posted 2007) [#11]
It's an option for when you compress the files. It takes longer to extract a single file from an archive, but improves the ratio of compression, especially if you have lots of similar file types (ie BMP). If it's an installer (and probably a self-extractable) then the single-file limitation doesn't matter.


xlsior(Posted 2007) [#12]
Another thought: Are you using integers to position your sprites or floats?


Grisu(Posted 2007) [#13]
"Also, .PNGs are larger than .BMPs when zipped" - Sorry, but this is NOT true from my experience. Also PNG are usually loaded faster than bloated BMP.

You can use a proper installer like Inno Setup if you aim for a professional release.


rockford(Posted 2007) [#14]
Grisu: In every single test case I tried with the same image(s) in .BMP and .PNG format, the .ZIP/.RAR file were smaller with .BMPs than .PNG files. I've tried this with single and multiple images, of varying sizes.

Try this example -

Create a 128x128 sized image in whatever package you want (I used MS Paint and just created a blank image).

.PNG image is 564 bytes
.BMP image is 48.0 Kb

As you can see (and as expected) the .BMP is larger when not zipped/rar'd.

Now...

Save that same image as .BMP and .PNG format - now .RAR them individually

For the .RAR BMP I get 139 bytes
For the .RAR PNG I get 330 bytes

.BMP image .RAR is significantly smaller (in bytes terms) - in this case less than half the size of .PNG.

Try it with multiple images. The .BMP RAR file is generally smaller.

Using .ZIP or .RAR yields the same end result - the .BMP file IS smaller.

.BMP is only more bloated when unzipped/unRAR'd.

I only found this out recently, so I can understand why you believe the opposite - but in practically every case the .BMP file is smaller when zipped/rar'd.

Give it a try on your own stuff and prove me completely wrong. I bet you can't categorically state that EVERY time, the PNG zipped/RAR file is smaller. I further bet that in most cases it's not. Just try it.

Xlsior: sprites are positioned with INTs, as I mentioned above


TaskMaster(Posted 2007) [#15]
A png file is already highly compressed. So, the rar/zip tool can't compress it a whole lot. png compression is optimized to have the best quality picture with as small a file size as possible. This compression technique does not lend itself to being compressed again.

But, which would you rather have as an end user? A 8MB zip file to download and a program that installs and takes up 20MB of disk space. Or a 11MB zip file to download and installs and takes up 13MB of disk? The downloaded file is on your hard disk for a very short time, the uncompressed may be there for a long time. Takes this a step further to a large game with many MB's of graphics. The difference is 100MB+ of installed files or 15MB+ of installed graphics.

I would rather have the slightly larger file to download rather than give up 10 times as much diskspace for the life of the installation.


popcade(Posted 2007) [#16]
It's true that PNGs are bigger when compressed, you can strip it to some size but you can do a comparsion yourself.

My way is to use MoleBox binding BMPs in, that results smaller and faster executable, for PNGs you need a buffer to decompress as pixmap, they cost the same in ram and it's only personal flavor to choose from.


rockford(Posted 2007) [#17]
I wasn't advocating using .BMPs or .PNGs for larger games - I was merely pointing out that in "MY" game (which is very small anyway and what this thread was all about!), I'm using .BMPs as they compress smaller than .PNG.

I have to pay for my bandwidth, so to me size as a downloadable IS important.

Grisu stated PNG zips were smaller than BMP zips - I was merely pointing out that he may not actually be correct in his assumption and offered conclusive proof that he should consider.

I don't give a toss about the end user's HD size - my game is small enough to fit on a floppy disk (at the mo) - so even when uncompressed a couple of extra meg isn't going to make a great deal of difference on a multi Gb HD. The days of 40Mb HDs are thankfully long gone and so is the worry of storage space.

When I download a game I don't think to myself - I've only got another XXXGb remaining, will this fill my HD? And I don't think anyone else does either. What I do think about is whether this 1000Mb download will be any good or is it just a waste of time downloading it in the first place.

And personally, I'd rather a smaller download - most games don't stay on my HD for very long anyway.

But that's only MY experience and MY opinion.

And as this thread was talking about my game, and gratefully resulted in the answer I required as a Noob to Max, but not as a Noob programmer (either to Blitz or other languages), then the job was a good'un.


TaskMaster(Posted 2007) [#18]
There are advantages and disadvantages to everything. There is no right or wrong way, just a matter of the right choice for the job. It is good to discuss them and get all of the pros and cons out so we can all understand them and maybe see something we didn't realize in the first place.

I don't think anybody was saying what you were doing was wrong, just discussing the options. And you obviously have a purpose for doing it the way you are. Nothing wring with that.

The whole "pay for bandwidth" thing never enters my mind as I have never had a service that did it like that. I realize there are some, and for you that is a factor. Thanks for enlightening me. :)