Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, June 1, 2010

Into Adobe Photoshop: Developed the Chennai script to improve photos: Mid day sun correction

Ever shot a photo on a very bright sunny day - The colors become dulled and almost everything looks over exposed. This happens all the time.

Even though everyone says that the best time to shoot is morning or evening, i find that I am having to shoot with the sun right on top at Noon.

I discovered that you can run a Adobe Photoshop steps
Adjustments -> Photo filter -> Cooling Filter 80 [To make it blue]
Adjustments -> Vibrance
Adjustments - Hue and Saturation[To get the color into a dull photo]

In fact , i had to repeat them often and saved it into a script [Or Action as adobe calls it]

Heres a sample
Before


After

Bookmark and Share

Tuesday, February 3, 2009

How to paste data from excel into an existing table in MS access 2007 without appending records

1. Export the table from access to excel
2. Update the records in excel
3. Create a form (datasheet) in access
4. Select the column(s) you have updated in excel
5. Select the column in the access form
6. Select paste special in access and paste as text

This retains updation in the order of the primary key and is fairly useful if you update based on excel sheets. Its usually better than  having a linked table.


Saturday, January 24, 2009

How I maintain my mp3 library using python

I use a combination of iTunes , iTunes updater and Media Monkey . Use media monkey to update the tags, and iTunes updater to read it into iTunes. I use iTunes since I like the interface to listen to my music.


This was after cleaning up with my own scripts for the folders that I inherited. I use a python file MP3Xplor.py to read the directory and the tags into a excel file (using pipe separated txt). I then correct it and send it back using the MP3Change.py file. 
MP3Xplor.py
#!/usr/bin/env python
#coding=utf-8
import ID3Writer
import id3reader

fIn = open('in.txt','r')

sStr= fIn.readline()

while sStr:
lStr = sStr.split("|")


fN = lStr[0]
id3r = id3reader.Reader(fN)
tr = id3r.getValue('track')
try:
tr = int(tr)
except:
tr = 1
art = id3r.getValue('performer')
tit = id3r.getValue('title')
yr = str(id3r.getValue('year'))
lbl = id3r.getValue('label')
ttltr = id3r.getValue('totaltracks')
try:
ttltr = int(ttltr)
except:
ttltr = 1

id3w = ID3Writer.Writer(fN,tr,lStr[2],lStr[3],lStr[1],yr,lbl,ttltr)
sStr = fIn.readline()

MP3Change.py
import os
#from tagger import *
import id3reader
fOut = open ("out.txt", 'w')
mp3attribs = ['album','performer','title','genre']
sStr = ""

for roots,dirs,files in os.walk(r'H:\Karthik\Music\Carnatic Music\Ariyakudi'):
for f in files:
if os.path.splitext(f)[1]=='.mp3':
fN = os.path.join(roots,f)
id3r = id3reader.Reader(fN)
i=0
sStr = sStr + roots+"|"+ f +"|"+fN
while i < len(mp3attribs):
sStr=sStr+"|"+str(id3r.getValue(mp3attribs[i]))
i=i+1
sStr = sStr + "\n"
fOut.write(sStr)
## i3 = ID3v1(fN)
## print roots,"|",f,"|",i3.album,"|",i3.artist,"|",i3.genre