bilinear and average weight resize

This is a discussion on bilinear and average weight resize within the Tech Board forums, part of the Community Boards category; I'm looking at the code of these two resize strategies and I'm uncertain of a few things.: (assume "sprite" as ...

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383

    bilinear and average weight resize

    I'm looking at the code of these two resize strategies and I'm uncertain of a few things.:

    (assume "sprite" as a 16x16 256 color or greyscale image. Assume a "canvas" as a 800x600 drawing area).

    Bilinear seems to provide the same end result quality to each individual sprite regardless if I apply it to a single sprite or to a canvas filled with sprites. Is this correct?

    Weighted average seems to perform poorly on low color images, but better if my canvas was chockfull of >16bit color sprites. Is this correct?

    I need to decide on a resize method for the above (in italics) scenario.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    A bilinear on one sprite will be the same as a bilinear on several sprites. The only difference is you will get some possible color variations at the borders of the sprite 'cells' depending on how each frame looks.

    Also you may want to look into cosine interpolation instead of linear interpolation for your filtering.

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383
    Thanks Bubba. Will look into this.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    No problem. I have the algorithms for cosine interpolation and bi-cubic filtering.

    I found them here:
    http://freespace.virgin.net/hugo.eli...s/m_perlin.htm

    I also have a trilinear filter algo but I cannot seem to find the site in my favs.

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383
    Very interesting website. That algo is a jewel.

    I'm leaning over to the bilinear algorithm since preliminary tests revealed it to be ideal for the 256 color images I'm working on with only average complexity - filled hexagons with small sprites. In layman terms, an hexagon war map.

    I'm unsure if I will need noise control and smoothing. But I'm about to find out. Thanks again
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    Your welcome. Glad to have helped.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21