RSS/Atom feed Twitter
Site is read-only, email is disabled

Automatize picture preprocessing...

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

4 of 4 messages available
Toggle history

Please log in to manage your subscriptions.

Automatize picture preprocessing... Durumdara 16 Mar 20:21
  Automatize picture preprocessing... David Hodson 16 Mar 23:53
   Automatize picture preprocessing... durumdara@gmail.com 17 Mar 11:43
    Automatize picture preprocessing... David Hodson 17 Mar 15:27
Durumdara
2008-03-16 20:21:55 UTC (almost 17 years ago)

Automatize picture preprocessing...

Hi!

I wanna automatize the photo picture preprocessing. I wanna call the auto color converters from python, if possible, without open the gimp, and open the files.

For example I wanna make auto white, auto level, auto color on all pictures, and make 3 images from the original to check what correction is better for it.

How can I do this? Can I do this like withPhotoShop API? See my PS code:

# encoding: iso-8859-2 import win32com.client, os, sys

app = win32com.client.Dispatch("Photoshop.Application") #print cs.ActiveDocument.Name
while 1:
l = app.Documents.Count
if l > 0:
if app.ActiveDocument <> None:
app.ActiveDocument.Close(2)
import time
time.sleep(0.5)
else:
break

def ProcessImage(FileName): for i in range(3):
app.Open(FileName);
doc = app.ActiveDocument;
if i == 0:
app.DoAction('KT', 'TEST')
elif i == 1:
layer = doc.ActiveLayer
layer.AutoLevels()
elif i == 2:
layer = doc.ActiveLayer
layer.AutoContrast()
jpgopt = win32com.client.Dispatch("Photoshop.JPEGSaveOptions") jpgopt.Quality = 12
import os
bn, ext = os.path.splitext(FileName) newfilename = bn + '_' + str(['col', 'lev', 'cnt'][i]) + ext doc.SaveAs(newfilename, jpgopt)
doc.Close(2)

def GetFileList(top): filenames = []
for root, dirs, files in os.walk(top, topdown=False): for name in files:
b, e = os.path.splitext(name) if e.lower() == '.jpg':
if b.find('_col') == -1 and b.find('_cnt') == -1 and b.find('_lev') == -1:
filenames.append(os.path.join(root, name)) return filenames

I tried DBP (DPB?) but it isn't works for me in Windows XP.

Thanks for your help: dd

David Hodson
2008-03-16 23:53:58 UTC (almost 17 years ago)

Automatize picture preprocessing...

Durumdara wrote:

> I wanna automatize the photo picture preprocessing. > [...]
> I tried DBP (DPB?) but it isn't works for me in Windows XP.

DBP (David's Batch Processor). Do you mean it was broken? Or it just didn't do what you wanted?

durumdara@gmail.com
2008-03-17 11:43:37 UTC (almost 17 years ago)

Automatize picture preprocessing...

David Hodson wrote:

Durumdara wrote:

> I wanna automatize the photo picture preprocessing. > [...]
> I tried DBP (DPB?) but it isn't works for me in Windows XP.

DBP (David's Batch Processor). Do you mean it was broken? Or it just didn't do what you wanted?

Hi!

I have Gimp 2.7 if I remember good.

I unpack the DBP to the bin dir.

I wanna start it, but there nothing happened. No application window showed.

Thanks: dd

David Hodson
2008-03-17 15:27:15 UTC (almost 17 years ago)

Automatize picture preprocessing...

durumdara@gmail.com wrote:

I unpack the DBP to the bin dir.

I wanna start it, but there nothing happened. No application window showed.

It's a Gimp plugin - put it into the plugins directory, then start (or restart) Gimp and look in the "Xtns" menu.