#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#       unbenannt.py
#       
#       Copyright 2011 Johannes ter Haak <jojo@jojo3>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.
#       
#       

import subprocess
import os
import pygame

path="../bild"

#
#	convertiert die bilder, so dass von jedem Bild ein "helles" dupluikat entsteht
#
def hell(liste): 
	for dos in liste:
		for img in dos[-1]:
			if img[-6:] == "-n.png":
				imgo = img[:-6]+"-b.png"
				imgo2 = img[:-6]+"-d.png"
				# light.. default 110,120 (brightness, saturation, hue)
				subprocess.call(["convert",path +"/"+img,"-modulate","110,120",path +"/"+imgo])
				# dark .. default 80,90,100 (brightness, saturation, hue)
				subprocess.call(["convert",path +"/"+img,"-modulate","75,55,100",path +"/"+imgo2])
				print "helligkeit adj "+ str(img)


#
#	convertiert die bilder in 3 grössen (also 2mal) für den zoom iml Spiel
#
def size(liste): 
	for dos in liste:
		for img in dos[-1]:
			if img[-9:-6] == "-z2":				
				imgo_0 = img[:-9]+"-z0" + img[-6:]
				imgo_1 = img[:-9]+"-z1" + img[-6:]
				subprocess.call(["convert",path +"/"+img,"-scale","25%",path +"/"+imgo_0])	
				print "size adj " + str(img) + " zoom factor 0"
				subprocess.call(["convert",path +"/"+img,"-scale","50%",path +"/"+imgo_1])
				print "size adj " + str(img) + " zoom factor 1"


############################################################################################################
############################################################################################################
liste = os.walk(path)
hell(liste)

liste = os.walk(path)
size(liste)




