Sections

  • Search Chrome Cow

Design a Day



Understanding (not to mention actually using) Photoshop’s Difference Layer

Over the years, I’ve accumulated a few different uses for Photoshop’s Difference Layer functionality, in much the same way I’ve accumulated old computer parts. I didn’t really go looking, it just sort of happened. My impression is that there are three kinds of Photoshop users: those who’ve never stumbled across Difference, those who have played with Difference and a few who actually use Difference. This how-to should appeal to all three.

What is this Difference You Humans Speak of?

A little bit of simple math up front, then on to the good stuff…I promise. There are a couple of different spots in Photoshop where difference shows up. For the following fooling around, assume that we’re talking about the Difference option that appears in the Layers blending menu.

What does it do? In simplest terms, it compares a layer to the layer just below it. Where the pixels have the same RGB value, it displays black (0-0-0).

Those zeros mean there is no difference between the two layers.

Original Image

Comparison Image

Let’s start with these two images. The original image on the top contains three swatches; 255 red / 255 blue / 255 green. The comparison image adds a stripe of white 255 / 255 / 255 on top, and black 0 / 0 / 0 on the bottom. If we place the comparison image in a layer above the original image and set that layer to Difference, we get this:

So what does that image tell us? Well, let’s start from the bottom. Where the comparison image was black, we see the original colors. What it means is the difference between black, where all the RGB values equal 0, and any other color is the the value of the original color:

In the middle stripe, where the colors are the same, which is to say, no difference, the result is a black strip. The difference between a red pixel and a red pixel is 0, green and green, 0, and so on.

Etc.

The top looks a little funky. What’s the deal? Well, now we have a white stripe, where all the RGB values equal 255. So now we get this:

The astute reader will notice that I’m not being consistent about what layer’s RGB values I’m subtracting, sometimes one, sometimes the other. All we are really interested in is the magnitude of the difference. The equation would actually look something like this:

  • Absolute Value of (Layer_1 Red - Layer_0 Red)
  • Absolute Value of (Layer_1 Green - Layer_0 Green)
  • Absolute Value of (Layer_1 Blue - Layer_0 Blue)

The bottom line: Where the images are the same, you get black. Where they are different, you get something else.




Use of the following content is governed by the Chrome Cow’s Terms of Service.

Games

Games

There are some Flash prototyping experiments here, as well as a downloadable boardgame. Leave feedback on the games in the comments. [ Link ]

Palabre Modules

Palabre Modules

Python Modules I have written for the open source Socket Server Project, Palabre. Palabre is a lean socket server with a nice user modules system. [ Link ]

LScript

Lscript

A collection of scripts for Lightwave 3D™. Includes the popular PDB Reader and Dial Ticks scripts. All scripts are saved in plain text. [ Link ]

Lscript UDF

LScript UDFs

A collection of various User Defined Funtions for Lightwave 3D™ contributed by several generous members of the scripting community. [ Link ]

Photoshop

Photoshop™ Actions and Scripts

Includes the Topomatic fake topo map generator, Schmootz, Sean’s HSB Paint tools, which allows artist to quickly the tweak Hue, Saturation and Brightness of the foreground color. [ Link ]

3D Objects

3D Objects

A number of freely available 3D objects in the Lightwave 3D™ format. Includes a small wind-up robot, and a clothespin. [ Link ]

WordPress Plugins

WordPress Plugins

Plugins for WordPress, popular blog software.
Currently includes ShowChildContent. [ Link ]

Excel Spreadsheets

Excel Spreadsheets

Various Spreadsheets in Excel 2003 format. Includes Perpetual Calendar tools. [ Link ]


Portrait of the Artist as a Mad Scientist

Do I contradict myself?
Very well then I contradict myself,
(I am large, I contain multitudes.)

Walt Whitman, " Song of Myself "

You see, I have projects. They come upon me unbidden, as my sweet wife knows too well. And then come the drills, duct tape, Lego, sculpey, magnets and dare I say it, lasers…the list is delimited only by the bounds of necessity.

These projects span the gamut from mechanical engineering to molecular biology, imaging technology to home decorating. Like I said, unbidden. So faced with a genetic predisposition to mad scientism, I decided it was either share the fruits of my tinkering on the web site, or build a secret base inside a volcano and work on world domination. As the current housing bubble* has made secret island bases prohibitively expensive**, I’ve chosen the former.

So let’s stroll by Chrome Cow Labs and see what’s cooking.


Use of the following content is governed by the Chrome Cow’s Terms of Service.

Macro Lighting Rig

A Macro Lighting Rig

The built-in flash on my camera doesn’t really work well for macro photography. Take a high-output halogen flashlight, add a few bucks worth of supplies, and you get a lightweight rig for lighting macro photos [ Link ]

The Rotisserie Scanner

The Rotisserie Scanner

What do you get when you cross a scanner with some serious Lego construction? A curiously eccentric cylindrical scanner. What happens when the scanner ends up on the front page of Slashdot? 33 gigs of transfer, 1.2 million hits and all sorts of fun. [Link]

Desktop 3D Scanner from Common (Geek) Household Supplies

Desktop 3D Scanner from Common (Geek) Household Supplies

The next step in rotisserie scanning: Actual 3D scanning. Using cheap re-purposed tech, I hope to build functional 3D scanner capable of digitizing objects several inches in height. [Link]


* I wrote this 3 years ago. Pop already!
** It’s actually not true. You can get some "fixer-upper" islands for less than a house in Boston. Volcano not included.


It is by teaching that we teach ourselves, by relating that we observe, by affirming that we examine, by showing that we look, by writing that we think, by pumping that we draw water into the well.

Henri-Frederic Amiel (1821-81)

Use of the following content is governed by the Chrome Cow’s Terms of Service.

Use a Cellphone Camera to Check Remote Control Batteries

Use a Cellphone Camera to Check Remote Control Batteries

Grab some popcorn; there’s a movie. Use you cellphone camera to check the batteries in remote controls in one easy step. Impress your friends and neighbors, win bar-bets. Link


Embrace Difference

Embrace Difference

Photoshop’s baffling Difference Layer; it’s often ignored, or used to ill purpose by those who enjoy its psychedelic flavor. But, honestly it’s not just for rave posters. Peek inside for the story they don’t want you to know. Link


Terraforming for Fun and Profit

Terraforming for Fun and Profit

A vibrant, water cover red planet; the stuff of legends? A multi-trillion dollar investment? Hardly. Using accurate information available for free on the net, add a touch of life to the Red Planet without increasing the budget deficit. Link


Drive on the Wrong Side of the Road

How to Drive on the Wrong Side of the Road

Taking a trip to the mirror-lands where they drive on the wrong side of the road? Here are some helpful hints and strategies for surviving your drive on the wild side. Link