Blurriness on Scale

BlitzMax Forums/BlitzMax Programming/Blurriness on Scale

zoqfotpik(Posted 2013) [#1]
Hi gents, I'm writing an engine that does direct pixmap draws, then scales up for a drawimage command to enlarge the pixmap to a reasonable size.

I'm experiencing a problem with scale and blur. I want my pixels to be square and well-defined. There appears to be some antialiasing or filtering that occurs on the scale. How can I avoid this?

Graphics 640,480
Global image:TImage = CreateImage(320,240) 
Cls

For i = 0 To 320
For j = 0 To 240
SetColor Rand(255),Rand(255),Rand(255)
Plot i,j
Next 
Next
GrabImage image, 0,0
SetColor 255,255,255
SetScale 2,2
DrawImage image, 0,0
Flip

While Not KeyDown(KEY_ESCAPE)
Wend



Jur(Posted 2013) [#2]
Change:
Global image:TImage = CreateImage(320,240,1,MASKEDIMAGE)


Kryzon(Posted 2013) [#3]
CreateImage() has flags. As it is now, it's using the default flags which includes FILTEREDIMAGE.

So to remove the filtering, use either a flag of 'zero' or MASKEDIMAGE if you need it masked.


zoqfotpik(Posted 2013) [#4]
Yep, figured it out :) Have to get up pretty early in the morning to get one past you gents...

I did this (320,240,1,MIPMAPPEDIMAGE|MASKEDIMAGE)

but obviously I don't want mipmapping so I will do away with that.