• Welcome to Dark Bit Factory & Gravity.
 

Blur image[BB2D]

Started by Paul, December 03, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Paul

Doing homework(as usual) but just wondering something...

QuoteAlso a good tip, with Blitz it has a plus side and can easily load in png's without the need for a huge amount of code / or external dlls, like Freebasic would need; so if you can save as them then I'd advise you to use them as they will make for much smaller media for when it comes to distributing later.

I had a *.jpg isn't that also small, even smaller that *.png sometimes?
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Stonemonkey

.jpg files are generally smaller than .png files but suffer from visual artifacts (visual errors in the image, the more compression used the worse it gets) whereas .png gives perfect quality with less compression.
Blitz can load in these filetypes without much work but with freebasic you'd need to write your own code to load them or use some .dll

Paul

QuoteYou have the 1d array doing 614400 pixels when it should only be doing 800x600 = 480000.

Jim

Not the way i'm doing it. I'm leaving 800 to 1024 empty so i can shift 10 steps, too save speed.
I will bite you - http://s5.bitefight.se/c.php?uid=31059
Challenge Trophies Won:

Jim

That's a good idea, but if you're comparing speed there, the top loop is still doing 100x614400 pixels and the bottom is doing 100x800x600 which is far less.  You're not actually skipping any pixels in the top loop, you're writing some of them off the right edge of the screen.

Say for instance in your top loop i=1023 at some point, then y=0 and x=1023.  That's off the screen.  When you come to write the last scanline, you'll be writing into memory you don't own and could get a gpf.
eg,
i=614399
y=599
x=614399-(599*1024)=1023

Jim
Challenge Trophies Won: