?

Recommended Answers

All 6 Replies

How many pics are you talking about. You can open all of them up in photoshop and do a save as wouldn't take that long to do 100 pics or so

I just happen to have it handy:

# convert all .tif file in a directory to .gif files
# needs Python Image Library (PIL) free from:
# http://www.pythonware.com/products/pil/index.htm

import os
from PIL import Image

# give the directory the TIF files are in
path = 'C:/temp/test/'
# make it the working directory
os.chdir(path)

for file in os.listdir(path):
    # assumes '.tif' is lower case
    if file.endswith('.tif'):
        img = Image.open(file)
        # change name *.tif to *.gif
        gif_file = file[:-4]+'.gif'
        img.save(gif_file)
        # indicate progress
        print( "%s converted and saved to %s" % (file, gif_file) )

I just happen to have it handy:

We all have interesting little snippets lying around. Too bad we can't find some way to create some sort of central index, but it is more than I have time for.

Image Files
     tif to gif
SQLite
     database - create
     database - modify record
Homework problems
     common
          primes - find all up to a certain number
etc.

We all have interesting little snippets lying around. Too bad we can't find some way to create some sort of central index, but it is more than I have time for.

Image Files
     tif to gif
SQLite
     database - create
     database - modify record
Homework problems
     common
          primes - find all up to a certain number
etc.

Well, there is a snippet section, but nobody ever looks there.

I just happen to have it handy:

# convert all .tif file in a directory to .gif files
# needs Python Image Library (PIL) free from:
# http://www.pythonware.com/products/pil/index.htm

import os
from PIL import Image

# give the directory the TIF files are in
path = 'C:/temp/test/'
# make it the working directory
os.chdir(path)

for file in os.listdir(path):
    # assumes '.tif' is lower case
    if file.endswith('.tif'):
        img = Image.open(file)
        # change name *.tif to *.gif
        gif_file = file[:-4]+'.gif'
        img.save(gif_file)
        # indicate progress
        print( "%s converted and saved to %s" % (file, gif_file) )

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.