Resize an image ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  11 November 2003
Resize an image ?

I wonder if anyone here could help me on how to resize an image file using max script in Max 5.1

I am working on a small script where I the user can select an image file, and based on his selection I want to show a small version of the image in the UI (as a bitmap).

In the help there seems to be no easy way to do a resize of a bitmap, and I wonder if anyone has an idea on how to do this?

  11 November 2003
You can use the copy method to do this.

Excerpt from the online reference:
Quote: copy <source_bitmap> <dest_bitmap>

Copies the source bitmap to the destination bitmap. If the size of the two bitmaps is different, the image will be scaled to fit the destination bitmap.

  11 November 2003
Thank you very much Magicm, I will try that out - never imagined that a copy could be used this way.

  11 November 2003
Quote: Originally posted by
Thank you very much Magicm, I will try that out - never imagined that a copy could be used this way.


While it works for stuff like quick previews, the result of the copying is not very smooth as it does not interpolate, it only repeats or skips pixels as necessary.

You can write your own resizing function using a bitmapTexture map and the renderMap method. This will use the Max renderer and will give you the option to filter the map.

Hope this helps.

  11 November 2003
Thank you very much Bobo I had also been thinking in the lines rendering the image somehow to get some nicer antializing etc., before Martijn gave me the idea with the copy (which as you also say gives nice results for quick previews etc.).

Your suggestion using the renderMap method is brilliant. I am currently studying the documentation more closely.

  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 11:51 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.