April 2007 - Posts

The Wedding Portrait - An exercise in Photoshop
A couple of weekends ago I had my first attempt at photographing a wedding. Portrait and event photography isn't something I'm particularly interested in - I much prefer landscape and sport. The bride was a close family friend, and the wedding was not overly formal and they didn't want a professional photographer for the event so I got the call up (owning a Canon 1 Series DSLR will do that). Overall, I found the photography enjoyable, but I should have been more prepared by carrying some drink and sports bars in my camera pack - you don't want to miss any of the action ducking out for a drink or a snack, so by the end of the event I was pretty thirsty and hungry.

I decided to print on photo out at A3+ (13" * 19") for the couple, and wanted to do a black-and-white print to give it more of a classical feel. The photo below, taken during the ceremony was the starting point for the print.



In terms of photographic quality, I'd describe the starting point as nice but with some obvious problems. I was too far away for the flash to have much of an effect in the strong sunlight that broke through during the ceremony (it was pouring rain 10 minutes after this), and the shadows in the original shot are a serious problem. The easiest Photoshop tool to cut rid of the severe shadows is to use Image | Adjustments | Shadows/Highlights..., but you can't apply this effect to an adjustment layer, so you have to start duplicating layers, which I don't particularly like to do. Knowing that Shadows/Highlights was going to come into play, and that it can give a weird fluorescent look to green vegetation like the background in this image, a mask to cover everything except the bride and groom was needed. Given that, the bottom-most visible layer would only contribute the green background to the final image, so I could blur and darken this to de-emphasize it, as shown below. This was done after duplicating the base so that an original was still available.


Next, I created a duplicate of the original layer, applied a fairly aggressive Shadow/Highlight adjustment, with Shadow amount set to 70%. Then, I brushed in a layer mask so just the couple where left from the layer.


On this layer, I removed any skin or lens blemishes with the Healing Brush and Blur Tool. Once I was happy with the result, I added a subtle lightening using an Adjustment Layer, and then took a duplicated Shadow\Highlight layer, applied an aggressive sharpening, and masked out everything but the eyes. The final layers look like:


Next, I grouped all the objects into a Smart Object, and used Convert to BW Pro 3 from The Imaging Factory on a rasterized copy of the Smart Object. The main options where to apply a light yellow-orange filter to enhance the skin tones and to bump up the contrast by setting the Paper Grade equivalent to around 3. The final result:


The left sides of the couples face, which was in really deep shadow, has been recovered well, and thanks to a little blurring, no artifacts are visible in the recovered areas. The job done by Shadow\Highlight is particularly impressive around the grooms chin and neck which look to be in total shadow in the original.

Overall, I was quite happy with the result. The end image (to my eye anyway) didn't look over-done, and the print looked fantastic.
Posted: Apr 18 2007, 05:01 AM by nick | with 1 comment(s)
Filed under:
SMH article of death of computer clubs
There was an interesting article in the SMH today on the death of computer clubs. As the co-president of a user group, the picture painted by the article seemed overly gloomy, and certainly doesn't represent the state of play for developer user groups. Last week's SDNUG meeting represented our 5th anniversary, and we are still very-much going strong. For a popular talk, we'll easily exceed the 80 person capacity of out venue at AMP Capital Investors, and we have at least ten new subscriptions to our mailing list each month. There are over 600 email addresses on the list, and we also have an RSS feed that gets many hundreds of hits a month.

One of the least accurate observations of the article (as it relates to SDNUG anyway) is that online communities are replacing face-to-face interaction. While attending a physical meeting is a significant time commitment over an online chat, the dynamics involved with an online vs. physical chat are totally different. I'm not a big IM fan for chatting, and find I'll rarely talk to someone on IM for more than 10 minutes when I could easily have a face-to-face conversation that lasts over an hour. A few of the things we do at SDNUG to offset the time investment is to set aside the first 30 minutes of the meeting for socialising over pizza and softdrink, we run a tight ship with getting speakers to finish at or close to 8pm so people can get home to their families at a decent hour, and we go to a pub afterwards so folks who want to continue the interaction for a longer time period can do so without any time limit.

Another key to our success is a close relationship with Microsoft that give a degree of street-cred, which was especially critical in the first six months when Dan and I where getting the whole thing started from scratch at a time when .NET had only RTM'ed three months earlier, and we had an established user group at North Ryde that we nominally a competitor (both groups are still going strong, and there is no sense of adversity or competition between Adam and us).

I'd like to see SMH do a corresponding article on the computer clubs and user groups that where doing well. From talking to most folks running groups on Microsoft-related technology, they all seem to be doing fine.
Posted: Apr 10 2007, 05:29 AM by nick | with no comments
Filed under:
Collections, derived types and generics
I'm sure someone has come up with this solution to collections of derived types in derived objects somewhere before, but I couldn't find the solution written up anywhere when I was trying to solve it, so I though I'd write it up for the sake of easy reference.

Suppose you have the following types to represent line items on an EDI document (property accessors removed to reduce code clutter):

class LineItem
{
string GoodDescription;
string ID;
}


class PurchaseOrderLineItem : LineItem
{
public decimal UnitPrice;
}

class ForecastLineItem : LineItem
{
public int DaysAhead;
}

There are a number of different types of EDI documents, all of which contain line items and all derived from a base EDI document, but how do you express the relationship between the elements in the collection without repeating the declaration of the collection in each derived EDI document type (which would kill the ability to handle the line items polymorphically) and yet still maintain strong typing so a forecast document could only store forecast line items?

The solution I cam up with was to use generics and generic constraints:

class EDIDocument<T> where T : LineItem
{
public List<T> LineItems;
}

class Forecast : EDIDocument<ForecastLineItem >
{
}

class PurchaseOrder : EDIDocument<PurchaseOrderLineItem>
{
}

With this solution, you get the two big wins and polymorphism and strong-typing at compile time, and this is achieved without a lot of extra code or any run-time performance penalty. After working on a project that (for a variety of reasonable technical and business issues) was stuck on .NET 1.1, solving real problems with generics is enjoyable.
Posted: Apr 04 2007, 01:13 AM by nick | with no comments
Filed under:
Don't waste your time with ATGen SDK for DotNetNuke
Warning: rant follows.

I do some work for a client who likes DNN, and despite my own personnel luke-warm-at-best feelings towards DNN, I do work to support a web solution based on it. Today, I was reminded why DNN and the surrounding projects aren't at the top of my list. ATGen SDK for DotNetNuke is a CRUD generating tool from AppTheory, and is listed as a feature template-set on the MyGeneration homepage. After spending half a day trying to get ATGen working, I found that the current version doesn't work with the latest version of MyGeneration (1.2), and the version that it does work with (1.1.5) is no longer available for download.

I appreciate that all the good folks around DNN give a lot of time and effort in a voluntary capacity and that ATGen isn't part of DNN proper, but its episodes like this where DNN and the sourrounding software eco-system really falls down as a viable offering for commercial work IMHO.

MyGeneration also deserve a swift kick in the pants for linking to a defunct template library from the main page of there site. As a long-term CodeSmith user, MyGeneration hasn't impressed me.
Posted: Apr 03 2007, 04:57 AM by nick | with 3 comment(s)
Filed under: