Thread: bilinear and average weight resize

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    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.
    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
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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
    Ireland
    Posts
    8,446
    Thanks Bubba. Will look into this.
    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
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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
    Ireland
    Posts
    8,446
    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
    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
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Your welcome. Glad to have helped.

Popular pages Recent additions subscribe to a feed