Ooops
April 02, 2020, 11:17:32 AM

Author Topic: rendering shrunken images when using setscale anti-aliases them  (Read 193 times)

Offline Juiceter

  • Jr. Member
  • **
  • Posts: 33
Hello fellow coders,

basically I don't want the subject title to happen. I've tried different blends using the setblend command but to no avail. Is there any way around this or am I missing (or forgetting) something simple - like the way to turn off anti-aliasing? Example below:

I'm basically trying to shrink a 2-colour graphic for a strategic map on the fly.

So you have the 1st attachment which is at full size (16*16 pixels per tile - 2 colours)

and the 2nd is at 8*8 pixels (unclear because of the anti-aliasing). 

Thanks for any help you may be able to provide.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2818
Re: rendering shrunken images when using setscale anti-aliases them
« Reply #1 on: March 16, 2020, 06:31:44 AM »
When loading images you can pass "flags"

https://www.blitzmax.org/docs/en/api/brl/brl.max2d/#function-loadimagetimage-urlobjectflags-1-



Without passing the flags they "AutoImageFlags defaults to MASKEDIMAGE | FILTEREDIMAGE."


bye
Ron

Offline Juiceter

  • Jr. Member
  • **
  • Posts: 33
Re: rendering shrunken images when using setscale anti-aliases them
« Reply #2 on: March 16, 2020, 07:00:42 AM »
Thanks so much Derron, I'll give that a try. What is confusing me is that some of the shrunken graphics render just fine
(see the red one - which represents a ridge - on the right of the blown up one) while others don't. Must be something to do with the way I have loaded them as you say. I had assumed I'd loaded them all the same way (this is a big project!).

I'll see if this fixes things and report back. Yet the above seems to be strange behaviour.

I noticed someone wanted to donate to you. You are always so helpful to everyone that I would also like to donate a little too to say thanks for being so kind to us all. You really have been a help to me at times when I have been stuck or lost focus in the past. Is there any way to do this?

Offline Juiceter

  • Jr. Member
  • **
  • Posts: 33
Re: rendering shrunken images when using setscale anti-aliases them
« Reply #3 on: March 16, 2020, 07:13:56 AM »
Yep the following fixed things.

AutoImageFlags MASKEDIMAGE=0 | FILTEREDIMAGE=0

Thanks for putting me back on track!

Offline Derron

  • Hero Member
  • *****
  • Posts: 2818
Re: rendering shrunken images when using setscale anti-aliases them
« Reply #4 on: March 16, 2020, 10:29:14 AM »
Think the donation stuff should be more directed to Brucey (the wonderful mind behind the BlitzMax NG project) - maybe you even meant him instead of me :). Regular donations could be done by sponsoring him and so the NG project on github - can be done via paypal (and other methods):


https://github.com/bmx-ng/bmx-ng

Also via paypal you could donate him some money as seen on his older private blitzmax page:
https://brucey.net/programming/blitz/index.php
(or just donate via "paypal friends" by using his email brucey@brucey.net)


@ autoimageflags
I am not sure if you should change the auto image flags ... better prepare a "Global pixelatedImageFlag:Int = your | flags" and use this variable everywhere you load an image which needs to stay "crisp/pixelated".

Else you might later run into issues of suddenly "non smoothed" stuff (maybe loadimagefont() would use that flags too?).


bye
Ron



Offline Juiceter

  • Jr. Member
  • **
  • Posts: 33
Re: rendering shrunken images when using setscale anti-aliases them
« Reply #5 on: March 16, 2020, 08:50:46 PM »
No, I meant you! You are always around to help everyone, or just nudge them back when they go off course (like I do sometimes). Of course, I'll support him too because I can see in Blitzmax what you and he (and most of us) can see. It's a terrific language. Well it was once I got the hang of it when I switched over from blitz basic on the Amiga.

Sometimes we as coders lose scope because blitzmax was never really well documented. Me? I've been dealing a lot with project parsing lately, meaning I lost sight with regards to things I have already dealt with (such as the graphical commands). Well that and the CFS (chronic fatigue syndrome) I have.


Good suggestion, but it should be fine as I've already loaded in the fonts and they render antialiased as they should do, so I'm happy with that.

I don't use ng (yet), but I'm certainly happy to send him some $. Thanks again for putting me back on track.  It's a pity Mark Sibley doesn't maintain his brainchild anymore, but I suppose ng is the next best thing.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2818
Re: rendering shrunken images when using setscale anti-aliases them
« Reply #6 on: March 16, 2020, 09:24:20 PM »
Thanks for your kind words. Went down my throat like oil :)

Brucey added a lot of documentation stuff to the "docs" at blitzmax.org - for some stuff the docus now contain pretty complex examples. It is just up to us to find them - and benefit from it in our projects.


bye
Ron

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal