how to change the texture file 2k to 1k with mel or python

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 09 September 2013   #1
how to change the texture file 2k to 1k with mel or python

Hello, I am know little maya programing .I have a question how to change the size of the texture file,like 4k to 2k、2k to 1k. using mel or python.
Thanks
 
Old 09 September 2013   #2
I've never done it directly in Python but I send commands to ImageMagick via my Python script.

http://www.imagemagick.org/Usage/resize/#resize
 
Old 09 September 2013   #3
The "Graphics Programming" forums are for non App specific programming discussion.
For application specific questions please post in the appropriate forums (in this case Maya/Programming).

Moved the thread for you.
__________________
Come, Join the Cult http://www.cultofrig.com - Rigging from First Principles
 
Old 09 September 2013   #4
i would it from python using PIL, or a other option would be to just use python and the com interface to control photoshop to do the work for you.
 
Old 10 October 2013   #5
I think you could python subprocess and droplet in photoshop. Depend of what software you have.
__________________
DrWeeny
My Blog
My Vimeo
LinkedIn
 
Old 10 October 2013   #6
i've done that using PIL. pretty pain free. i found that much easier than using imageMagick or doing javascript in photoshop.

edit ** something like this.

import PIL as Image

size = 256, 256
openImage = Image.open(filePath)
openImage.thumbnail(size, Image.ANTIALIAS)
openImage.save(newFile)

and the nice thing about PIL is that it can read the imageSize and info about it without having to actually open it, unlike MEL which has to load it into memory, so it's much faster at processing than MEL.
__________________


Last edited by stallion151 : 10 October 2013 at 11:07 AM.
 
Old 10 October 2013   #7
thank you

Originally Posted by stallion151: i've done that using PIL. pretty pain free. i found that much easier than using imageMagick or doing javascript in photoshop.

edit ** something like this.

import PIL as Image

size = 256, 256
openImage = Image.open(filePath)
openImage.thumbnail(size, Image.ANTIALIAS)
openImage.save(newFile)

and the nice thing about PIL is that it can read the imageSize and info about it without having to actually open it, unlike MEL which has to load it into memory, so it's much faster at processing than MEL.

thank you.
 
Old 10 October 2013   #8
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 03:03 AM.


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