Jump to content
  • Advertisement
Sign in to follow this  
ade-the-heat

convert 300+ bmps to half the size

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I have 300+ bitmaps at 256x256 in size. I want them to be 128x128 in size - so as to shrink the size of the game. I have a wonderful photo editor than can do it that I got with my digital camera. However, it would take ages to do each on in turn. So how do I do it ? I mean I can program it - but what do I do - take every other pixel and write to the new bitmap - my photo editor does a wonderful job by hand ! cheers Ade

Share this post


Link to post
Share on other sites
Advertisement
I know Paint Shop Pro and Photoshop have Macros in them or something like that. You could set up a macro to select all 300 files and do the conversion in batches. I think this is possible anyway, no promises so don't flame me if I'm wrong.

Share this post


Link to post
Share on other sites
An easy way to shrink it would be to extract chunks of 2x2 pixels from the original images, find the average color of these four pixels, and write this color to one pixel in the output image.

So a 4x2 image


A A B B
A A B B


Would become


a b


Where the small letters are the average of the large ones.

Share this post


Link to post
Share on other sites
For something like this you could write a quick script in Python using something like PIL. At least that's what I'd do anyway.

kevin

Share this post


Link to post
Share on other sites
Ah, the wonders of a good command-line interface:

for i in *.bmp; do mogrify -resize 128x128 $i; done

mogrify is part of ImageMagick, a fine free set of image-processing tools. It is available for Windows too.

EDIT: mogrify can take an arbitrary number of files to convert, so it suffices to do mogrify -resize 128x128 *.bmp. For loops come in handy in more complex situations, though.

[Edited by - Sharlin on May 11, 2005 12:23:11 PM]

Share this post


Link to post
Share on other sites
With IrfanView it's pretty easy:

i_view32 *.bmp /resample=(128,128) /c=output\*.bmp

will put resized pics in "output"-dir.

Share this post


Link to post
Share on other sites
Download image resizer powertoy from microsoft, select all images, right click them->resize->custom size->128x128->hit ok.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!