.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $6.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old May 1st, 2008, 08:19 AM
Ragnarok-X's Avatar

Ragnarok-X Ragnarok-X is offline
Major General
 
Join Date: Jan 2004
Location: Germany / Bielefeld
Posts: 2,035
Thanks: 33
Thanked 18 Times in 12 Posts
Ragnarok-X is an unknown quantity at this point
Default OT: Automated resizing of images ?

I need to convert a load of 512x512 sized images into 128x128. Anyone knows about a automated method/tool to do so ?
Reply With Quote
  #2  
Old May 1st, 2008, 10:40 AM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Automated resizing of images ?

Maybe Gimp?
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #3  
Old May 1st, 2008, 12:11 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: OT: Automated resizing of images ?

IrfanView can do that... hmm, converting SE5 portraits to SE4 size?
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #4  
Old May 1st, 2008, 01:52 PM
geoschmo's Avatar

geoschmo geoschmo is offline
National Security Advisor
 
Join Date: Jan 2001
Location: Ohio
Posts: 8,450
Thanks: 0
Thanked 4 Times in 1 Post
geoschmo is on a distinguished road
Default Re: OT: Automated resizing of images ?

Irfan view does a great job of it. I've got a script that runs on the PBW server using irfan view which resizes, crops, and changes the flag bitmaps to jpegs and sticks them in the image folder for the game page previews.
__________________
I used to be somebody but now I am somebody else
Who I'll be tomorrow is anybody's guess
Reply With Quote
  #5  
Old May 1st, 2008, 02:41 PM
Ragnarok-X's Avatar

Ragnarok-X Ragnarok-X is offline
Major General
 
Join Date: Jan 2004
Location: Germany / Bielefeld
Posts: 2,035
Thanks: 33
Thanked 18 Times in 12 Posts
Ragnarok-X is an unknown quantity at this point
Default Re: OT: Automated resizing of images ?

Yeah got. Its really good, you can as well rename the batch and or extensions or something. Thanks.
Reply With Quote
  #6  
Old May 1st, 2008, 02:55 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: OT: Automated resizing of images ?

I prefer Python's PIL library myself. Less overhead, less hassle with Irfanview's bizarre interface and interpretation of settings.. This little script helps me prepare shipsets for posting in the SEnet shipyards. I didn't have to do any resizing, but you can find info on how to do that here.

(bloody code tag sucks... stupid extra line breaks)


# http://www.pythonware.com/library/pi...book/image.htm
from PIL import Image

import sys
import os
import re
import shutil

shipset_path = sys.argv[1]

if len(sys.argv) > 2:
if sys.argv[2] == 'se4' or sys.argv[2] == '4':
game = 'se4'
else:
game = 'se5'
else:
game = 'se5'

files = os.listdir(shipset_path)

set_name = shipset_path.rstrip('_')

out_path = 'D:/Internet/SEnet/home/modules/Shipyards/images/races/' + game + \
'/' + set_name.lower() + '/'

try:
os.mkdir(out_path)
except WindowsError:
1

# Create an empty index.html file.
index_file = open(out_path + 'index.html', 'w')
index_file.close()

portrait_match = re.compile('_portrait_[a-z]+.bmp')

mini_match = re.compile('_mini_[a-z]+.bmp')

se4_specials = [set_name.lower() + '_pop_mini.bmp', set_name.lower() + \
'_pop_portrait.bmp', set_name.lower() + '_main.bmp', set_name.lower() + \
'_bigexplosion.bmp', set_name.lower() + '_shields.bmp']

for f_raw in files:
f = f_raw.lower()

if f == set_name.lower() + '_flag_texture.bmp' or f == set_name.lower() + \
'_race_portrait.bmp' or portrait_match.search(f) != None or \
(game == 'se4' and mini_match.search(f) != None or f in se4_specials):

im = Image.open(set_name + '/' + f)
im.save(out_path + f.replace('.bmp', '.png'), 'png')

# Create a preview image.
if game == 'se5':
shutil.copyfile(set_name + '/' + set_name + \
'_LargePortrait_Dreadnought.jpg', 'preview/' + set_name.lower() + '.jpg')
else:
im = Image.open(set_name + '/' + set_name + '_Portrait_Dreadnought.bmp')
im.save('preview/' + set_name.lower() + '.png', 'png')
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
Reply

Bookmarks


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 02:30 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2024, Shrapnel Games, Inc. - All Rights Reserved.