Author Topic: Blur image[BB2D]  (Read 2245 times)

0 Members and 1 Guest are viewing this topic.

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Blur image
« Reply #20 on: December 08, 2006 »
Doing homework(as usual) but just wondering something...

Quote
Also 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:

Offline Stonemonkey

  • Pentium
  • *****
  • Posts: 1274
  • Karma: 95
    • View Profile
Re: Blur image
« Reply #21 on: December 08, 2006 »
.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

Offline Paul

  • Pentium
  • *****
  • Posts: 1490
  • Karma: 47
    • View Profile
Re: Blur image
« Reply #22 on: December 10, 2006 »
Quote
You 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:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5243
  • Karma: 393
    • View Profile
Re: Blur image
« Reply #23 on: December 10, 2006 »
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: