Is there any scaling method to resize with samplin

BlitzMax Forums/BlitzMax Programming/Is there any scaling method to resize with samplin

D4NM4N(Posted 2009) [#1]
Is there any scaling method in MAX to resize an image with inteligent re-sampling? I need to make some (quality) thumbnails from like 3000 images.

Speed not an issue as its a batch-render process, not a game.


Arowx(Posted 2009) [#2]
I think there is only MIPMAPPED (flag, Used when loading an image), you could always scale buy averaging the pixel values using a TPixmap which gives you acces to individual pixels in an image.

Other than could you specify what kind of re-sampling your after?


ImaginaryHuman(Posted 2009) [#3]
Either use FILTEREDIMAGE with images, draw it scaled down to the backbuffer and grab it, or write your own floating-point bilinear filter using pixamps.


D4NM4N(Posted 2009) [#4]
Ok thx.

I want the kind of scaling that doesnt simply do a linear chop. What i am after is the kind of photoshop/gimp/paintshop resize (bilenear i think) that can preserve/antialias the strong details (like scaling a lineart drawing).

I will try the regrabbing a draw with filteredimage flag and see what that gets me.

Failing that i guess i will have to write my own (groan)


Jesse(Posted 2009) [#5]
but don't you need the alpah channel? if you grab from the backbuffer you loose the alpha channel.


D4NM4N(Posted 2009) [#6]
Not for this no.


Brucey(Posted 2009) [#7]
What about one of those Windows batch image manipulation apps?


Otus(Posted 2009) [#8]
I had to do the same a few months back for some hundreds of images. I used Brucey's FreeImage Wrapper. Here's my code (quick & dirty), in case you find something in it useful:




D4NM4N(Posted 2009) [#9]
hmm, thanks for that i will analyse it now :)