Skip to main content

a digital study of Colour

I've been doing some programming lately (coding an application to load onto my camera that makes the camera capable of taking high dynamic range photos natively), but writing this application has made me notice a few things about the colour, light intensity and tone of a digital image. There are some things I have taken for granted really about working with coloured images in photoshop, never really having dealt with the nitty gritty details of image enhancements that I'm forced to learn all about now. I feel like sharing a couple of these interesting insights, however obvious they seem to be.

First off, lets explore how important the varying levels of brightness is to a photo. Take, for example, this following image.

(Image credit of Alexiuss @ http://alexiuss.deviantart.com/art/Seasonscape-69489448)

It's a lovely image, but lets see what happens to the image when we remove the varying levels of brightness (or shading I guess you could call it); we're just going to leave behind the colour hues.

We are left now with a colorful, but rather confusing, image made up of several main colors: cyan, green, yellow, red, magenta, and blue. White represents an area lacking colour. Even though a coloured image in principal requires three times more information than a black and white image, all that added information provides relatively little use on it own it seems.

Next, lets look at the opposite effect; turning a coloured image into a black and white (gray scale) image. The thing is, how do you do this? If there are three colour channels in a coloured image, (Red, Green, and Blue,) how best do you combine them to make just one black and white channel?


First up, it seemed logical to me to just average all three RGB colour channels to make the black and white image: the above is the outcome. Overall, I was pleased with this first result, but after reading up some more on the behaviour of light, color and human perception, I realized that the ideal method might not be just so simple.

One thing to realize is that the human eye sees different luminosities for each of the three main RGB colours. In the above image, the ratios 0.3 : 0.6 : 0.1 were used to combine (add up) the RGB channels to make just one whole channel. The idea is, the human eye sees green as being 6 times as bright as blue and twice as bright as red. But is this even the best method?


The above image was produced by squaring each of the RGB colour channels, adding up the results, and then rooting that sum. I actually really liked this result; it makes some sense that the brightness of a color might not be linear in nature, but even if that is not the case, visually I found this result the most appealing.


Lastly, I wanted to see how my paint application defined brightness to see if I could duplicate how it might produce a black and white image from a colored image. Its method was actually performed by taking the lowest and highest valued channel (per coloured pixel) of the three RGB channels and just averaging them-- completely ignoring the third colour channel! The above is the result.

In the end, I have tested 4 different methods of producing a black and white image from a coloured image- and there are probably a dozen more other ways yet unmentioned here. I wish I could say there was 'a best' method, but it appears that it all comes down to personal preference. Some of the methods may be considered more accurate, numerically or perceptually, and other ways may just look nicer. In the end, it may not really matter, as the end results of the different methods were all still very similar. Can you see the differences?

For something that seemed at first so simple, I'm amazed to find that working with coloured images at the nitty gritty level becomes quite the chore. My headaches do not end there however, as modifying and combining the dynamic ranges of multiple images introduces new challenges as well. It turns out that just averaging two identical photos (with just different exposures) produces pretty decent results! It may not be the best method of producing an HDR image, but it sure is easy. (bonus: simply averaging the images also seems to reduce image noise!)

Comments

Popular posts from this blog

How to login to an expired Windows

Microsoft has a neat little way to prevent software piracy of their Windows operating system. "Windows Genuine Advantage"[edit: I stand corrected, it has nothing to do with WGA] with its "Product Activation" requirement. Essentially, even with a valid product key, you still need to activate your Windows to ensure that only one computer is using that specific product key. If you can't activate your Windows, there being many reasons for this, you are left with a 30 day grace period to change your product key to one that is fully valid or get in contact with Microsoft and plea your case. Once your grace period is up, Windows refuses to let you login anymore. You cannot access your files. You cannot go on the Internet. You cannot do anything, except the thrill of trying to activate Windows. Well, luckily for me I do not have to worry about this issues, as my Windows is valid and activated. However, for those who do not and have been so unfortunate enough to have

ATi Radeon 5770: PCIe x16 vs PCIe x8

In this article I will reveal the differences one should expect from running an ATi Radeon HD 5770 1GB graphics card at full and half PCIe 2.0 bandwidth. This is particularly important data for those considering a dual ATI 5770's Crossfire setup on today's Intel-based P55 motherboards which generally offer only a single PCIe x16 slot or two PCIe x8 slots. Are you better off with a X58 motherboard for Crossfire that offers dual PCIe x16 slots? Would just a more powerful single slot graphics card, such as an ATI 5870, be a better call? I can't tell you that, since you may find Crossfire annoying or you may want the absolute best performance from your rig. What I can show you though is if Crossfire on a P55 motherboard is a viable option, especially for those trying to save a quick buck. Read on! While other reviews of limited PCIe bandwidth have been addressed prior, such as at Tom's Hardware, these looked at either now-out-dated video cards or very expensive graphics

The Hard Drive Capacity Calculator

Curious why when you buy an iPod, computer hard drive, or memory stick there is less memory actually available then what was advertised? For example, you buy a new laptop, advertised having 100GB of hard drive space, actually only seems to have 93GB available? It almost seems as if there is false advertising involved. I'm sorry to say, this isn't the case, rather just a tricky usage of terminology used by memory manufactures. Let me try to explain... You see, digital data is of binary numbers. 1's and 0's, also called bits. A group of eight (8 bits) 1's or/and 0's describe what is known as a byte. There are hence, 256 different values for a byte. ie: 00000000, 00000001, 00000010, 00000011, ... 11111110, 11111111. Digital memory is measured in the number of bytes, although it can also be described in bits. This is where it gets a bit more confusing.... Just as with our decimal number system, when a very large binary number needs to be described, such as 123,456,7

Some features of digital cameras

Most of us already have a digital camera that suits our needs. Quite possibly it's a brand of camera you bought at Walmart on sale that no one has ever heard of before, maybe it's the one integrated into your cell phone, or maybe your camera doesn't suck and you are thinking to yourself, what is the point of this article!? Well, I'm hoping to share a short list of some of the commonly overlooked or new features of digital cameras today that you might be missing out on. You might even find them all just enough of a reason to change what you are hoping for this Christmas. 1. Image Stabilization What was once only found in professional cameras has now found its way to the masses. Image stabilization technologies could very well be the biggest change for digital cameras since the auto-focus. With image stabilization you can take photos or video clips without a tripod that would otherwise be blurry due to an unsteady hand. Even with a steady hand, trying to take a photo whi

Intel Core i7 860: Stock Cooler and Power Usage

I'm just throwing this out there for anyone else running into similar problems as I have been having with my Intel Core i7 860 system. I'm noticing that a lot of heat is being produced from these chips when at full load and especially when overclocked, to the point that I feel the stock CPU cooler from Intel is simply inadequate. The included heatsink/fan included with the Intel Core i7 860 has a low-profile design that is smaller than previous Intel coolers, which seems a bit strange in my opinion considering that these chips are rated at 95W TDP. Anyways, I bought two Core i7 860 systems, one featuring a Gigabyte P55M-UD4 motherboard and another one using a Gigabyte P55A-UD4P motherboard (primary board used in this review). Using the stock Intel cooler, I could effortlessly overclock these systems to 3.5GHz using stock voltages. While the systems were stable for all intensive purposes, running Prime95 would cause the core CPU temperatures to shoot up quickly to 100*C (usin

Review of the New Dell Studio 15 (1555) Notebook

Hi everyone, welcome to my review of the new Dell Studio 15 (1555) notebook. I have had the notebook in my possession for just a few days as of this writing, so the review at this time will focus mostly on my first impressions of the device. I will update this article as I gain more experience using this system, so check back soon for added information or send me your questions via email for a prompt reply. The system under review has the following specifications: Processors Intel® Core™ 2 Duo P8600 (2.4GHz/1066Mhz FSB/3MB cache) Memory 4GB Shared Dual Channel DDR2 at 800MHz Keyboard

Review: Lenovo Bluetooth Laser Mouse

In an attempt to give back to the community a bit, I am going to giving a review of my experience with Lenovo Canada and two new products I have recently ordered from it online. The two products are the Lenovo T400 14-inch notebook and a Lenovo Bluetooth Laser Mouse. Purchasing I ordered online both the T400 and the mouse late Monday night, from Lenovo .com. The total price, after tax, was about $1,250. Before tax, the T400 cost me $1070, while the mouse cost me $27 (regular $45). Shipping was free. I scored a bit of a deal on the purchase thanks to some e-coupon codes that were mentioned over at Redflagdeals .ca. These e-coupons saved me a lot of money, but it still took about a month of constant checking before Lenovo had what I wanted in stock and at a decently low price. Shopping at Lenovo .com is a bit like playing the stock market; there are ups and downs. One day the LED back-lighting feature would cost $370, the next day it would be just $30. In the rare case, it

Lenovo T400 Review

So, let my review of the Lenovo T400 begin. Configuration under review Lenovo T400 14.1-inch LED 1440x900 display Intel Core 2 Duo P8600 CPU (2.4 GHz, 3 MB L2 Cache, 25 W TDP) 3 GB of DDR3-1066 MHz RAM Switchable graphics: Intel GMA X4500MHD or ATI Mobility 3470 /w 256 MB Bluetooth Intel 5300 WiFi 80 GB 5400 HDD Webcam Media Card Reader Windows Vista Home Basic 9-cell extended battery Price: $1070 CAD (Ordered November 24th, Delivered December 4th) Also ordered a Lenovo Bluetooth laser mouse. Price: $33 (Delivered in 1.5 days) Prices were substaintially discounted, thanks to a friends of employees discount and an addition e-coupon code. CPU Performance: 1M on SuperPI Mod 1.5 scored about 21 seconds. For comparison, my 3 year old AMD Sempron 3000+ overclocked to 2.4 GHz scored 50 seconds and my brother's 2 year old Intel Core 2 Duo E6300 overclocked to 3.0 GHz scored 19 seconds. The processor is very efficient in both terms of clock cycles and power savings, but compared to modern-d

Google's Web Toolkit 1.3 RC1 now out

Not everyone knows what AJAX is, not everyone will care, but for those who do and don't know this already, check out Google's Web Toolkit . As a hobbyist web developer, I know just how frustrating it can be to design a website with really neat functionality and layout. I have been really amazed at how Google creates their many websites, having them all lack that rudimentary feel most older websites today have. Google has really gone above and beyond by releasing the same tools to the public, for free, that they have used to make their very own websites. To top it off, they even have now released the source code for this Web Toolkit of theirs. The toolkit simplifies the programming process by converting easy-to-write Java code into the painfully tricky to perfect AJAX stylings. What does this mean to anyone who doesn't speak Geek? Well, expect fancier, more powerful, and more intuitive websites to start showing up on Internet that don't have multimillion dollar developer

Logitech LX 500 Review

So after a recent incident with my old keyboard involving a kitten and a bottle of diet coke, it was time for a new keyboard. Enter the Logitech LX 500. I found the keyboard for sale at my local computer shop as a weekend door crasher special for 15$ - strange how they still had plenty in stock despite it being Sunday afternoon. It fit my price range and included a decent mouse, so... :$: Cha Ching :$: The keyboard and mouse unboxed The 800 dpi wireless optical mouse is a dark blue and black in colour, with two main buttons, a horizontally and vertically scrolling capable clicking scroll wheel, and a smallish button underneath it for tabbing between windows. The tabbing button does not function without the included software being installed, but the basic mouse functions were working right away. A pair of regular Duracell batteries were included with it. Overall, my impression of the mouse is good for what it is. It feels nice and, even for it not being a very large mouse, it still fit