I received my Arduino Duemilanove yesterday so last night I rushed off to Maplin's to buy myself a handfully of goodies to start playing around. I bought myself a bunch of LEDs a bag of resistors and a couple of tactile switches.
It was no trouble at all to get the board up and running on my XP machine and within a couple of minutes had my blinking LED program running. I have decided to work through a few of the tutorial posts before jumping into the 'Flash Trigger Project' just to refresh my electronics knowledge as its been about 16 years since I last had a play around, and that was going my GCSEs.
I have loads of thoughts on what I want to do with my project, and as I previously mentioned I managed to secure a couple to Stephen Eatons strobit boards that will be used for my final trigger. I will prototype using my Arduino Duemilanove board until all my bits to complete my strobit boards arrive. It also looks like I am going to have to wait about 14 days to receive the hope RF12B which is pretty annoying, but atleast it will give me more time to learn.
I will be posting up pictures and info as I work through some projects and will post up and code that I write that may be of use to others, but this blog entry is to say I've started, and Im excited......
TopHatTaylor's Blog
Wednesday, 27 May 2009
Wednesday, 20 May 2009
Python RGB Histogram using PIL module
I have been playing with a few image projects using PIL, and decided that I wanted to create some RGB histograms of my images that I could use on my website. I am a keen photographer and I will we uploading my images to my blog soon, but I wanted to have something a little different.
It is quite normal for people to post up EXIF data from their images but not many people post up histograms. There is a reason for this, and thats after the image has been through post processing there is not really alot of point of the histogram, but what the hell I will post it anyway.
So I took a look at PIL to see how it could help me out, and I have put together a small script that reads the image data and produces a nice histogram of it. The example histogram shown above has been created from the following image. You can click though to view the full size image on Flickr.
So here is the script that makes the histogram, feel free to copy and adapt it to do whatever else you want it to do. I have created a few variables at the top of the script that should allow people to quickly modify the code to fit in with their own styling.
I am planning on adding more to this script and will probably and the CMY colors to it in the near future so that it is more similar to the Adobe Lightroom Histogram.
It is quite normal for people to post up EXIF data from their images but not many people post up histograms. There is a reason for this, and thats after the image has been through post processing there is not really alot of point of the histogram, but what the hell I will post it anyway.
So I took a look at PIL to see how it could help me out, and I have put together a small script that reads the image data and produces a nice histogram of it. The example histogram shown above has been created from the following image. You can click though to view the full size image on Flickr.
So here is the script that makes the histogram, feel free to copy and adapt it to do whatever else you want it to do. I have created a few variables at the top of the script that should allow people to quickly modify the code to fit in with their own styling.
# RGB Hitogram
# This script will create a histogram image based on the RGB content of
# an image. It uses PIL to do most of the donkey work but then we just
# draw a pretty graph out of it.
#
# May 2009, Scott McDonough, www.scottmcdonough.co.uk
#
import Image, ImageDraw
imagepath = "mZXN_1979" # The image to build the histogram of
histHeight = 120 # Height of the histogram
histWidth = 256 # Width of the histogram
multiplerValue = 1.5 # The multiplier value basically increases
# the histogram height so that love values
# are easier to see, this in effect chops off
# the top of the histogram.
showFstopLines = True # True/False to hide outline
fStopLines = 5
# Colours to be used
backgroundColor = (51,51,51) # Background color
lineColor = (102,102,102) # Line color of fStop Markers
red = (255,60,60) # Color for the red lines
green = (51,204,51) # Color for the green lines
blue = (0,102,255) # Color for the blue lines
##################################################################################
img = Image.open(imagepath)
hist = img.histogram()
histMax = max(hist) comon color
xScale = float(histWidth)/len(hist) # xScaling
yScale = float((histHeight)*multiplerValue)/histMax # yScaling
im = Image.new("RGBA", (histWidth, histHeight), backgroundColor)
draw = ImageDraw.Draw(im)
# Draw Outline is required
if showFstopLines:
xmarker = histWidth/fStopLines
x =0
for i in range(1,fStopLines+1):
draw.line((x, 0, x, histHeight), fill=lineColor)
x+=xmarker
draw.line((histWidth-1, 0, histWidth-1, 200), fill=lineColor)
draw.line((0, 0, 0, histHeight), fill=lineColor)
# Draw the RGB histogram lines
x=0; c=0;
for i in hist:
if int(i)==0: pass
else:
color = red
if c>255: color = green
if c>511: color = blue
draw.line((x, histHeight, x, histHeight-(i*yScale)), fill=color)
if x>255: x=0
else: x+=1
c+=1
# Now save and show the histogram
im.save('histogram.png', 'PNG')
im.show()
I am planning on adding more to this script and will probably and the CMY colors to it in the near future so that it is more similar to the Adobe Lightroom Histogram.
Labels:
adobe lightroom,
histogram,
photography,
PIL,
python
Monday, 18 May 2009
Pocket Wizard Flash Triggers: Part I
I have wanted to buy a set of Pocket Wizards for a while now, but have been having trouble trying to justify spending close to £600 on a set. I have two SB800s and am looking to add another to my collection, so that really increases in the cost as I would need 4 of those pricey little buggers!
I am currently using Nikon's Creative Ligthing System (CLS), but am beginning to want a bit more range or through wall action! I have had a look at the povertyWizards and gadgetInfinities but after reading reviews and listening to other peoples comments they dont seem that reliable.
Thankfully there looks like there maybe an alternative after all! I will build my own!!! Although I dont have a great deal of electronics experience, I have seen there is a "strobit open source project" to build your own triggers. With a wealth of knowledge out there on the internet I am going to try to build my own set. I have just ordered up a few componenets and an electronics book and will keep my blog updated with my progress.
I will say thanks to Stephen Eaton for his help already and for kindly sending me a couple of PCB boards to get me started! (They arrived this morning 20/5, so will be playing very soon!)
I am currently using Nikon's Creative Ligthing System (CLS), but am beginning to want a bit more range or through wall action! I have had a look at the povertyWizards and gadgetInfinities but after reading reviews and listening to other peoples comments they dont seem that reliable.
Thankfully there looks like there maybe an alternative after all! I will build my own!!! Although I dont have a great deal of electronics experience, I have seen there is a "strobit open source project" to build your own triggers. With a wealth of knowledge out there on the internet I am going to try to build my own set. I have just ordered up a few componenets and an electronics book and will keep my blog updated with my progress.
I will say thanks to Stephen Eaton for his help already and for kindly sending me a couple of PCB boards to get me started! (They arrived this morning 20/5, so will be playing very soon!)
Labels:
open source,
photography,
spot-trigger,
strobist
Subscribe to:
Posts (Atom)