Tracking and organizing my clothes: substituting mathematics for fashion sense

Thumbnails of clothes

Inspired by my sister’s photo-assisted organization of her shoes, I decided to tackle my wardrobe. Taking an inventory would make it easier to simplify, replace, or supplement my clothes. Analyzing colour would help me substitute mathematics for a sense of style. Combining the images with the clothes log I’ve been keeping would make it easier to see patterns and maybe do some interesting visualizations. Geek time!

I took pictures of all my clothes against a convenient white wall. I corrected the images using Bibble 5 Pro and renamed the files to match my clothes-tracking database, creating new records as needed. AutoHotkey and Colorette made the task of choosing representative colours much less tedious than it would’ve been otherwise. After I created a spreadsheet of IDs, representative colours, and tags, I imported the data into my Rails-based personal dashboard, programming in new functionality along the way. (Emacs keyboard macros + Rails console = quick and easy data munging.) I used Acts as Taggable On for additional structure.

It turns out that the math for complementary and triadic colour schemes is easy when you convert RGB to HSL (hue, saturation, lightness). I used the Color gem for my RGB-HSL conversions, then calculated the complementary and triadic colours by adding or subtracting degrees as needed (180 for complementary, +/- 120 for triadic).

Here’s what the detailed view looks like now:


And the clothing log:


Clothing summary, sorted by frequency (30 days of data as of writing)



  • White balance and exposure are a little off in some shots. I tweaked some representative colours to account for that. It would be neat to get that all sorted out, and maybe drop out the background too. It’s fine the way it is. =)
  • Matches are suggested based on tags, and are not yet sorted by colour. Sorting by colour or some kind of relevance factor would be extra cool.
  • Sorting by hue can be tricky. Maybe there’s a better way to do this…
  • My colour combinations don’t quite agree with other color scheme calculators I’ve tried. They’re in the right neighbourhood, at least. Rounding errors?
  • I’ll keep an eye out for accessories that match triadic colours for the clothes I most frequently wear.
  • Quick stats: 28 casual tops, 15 skirts, 12 office-type tops, 8 pairs of pants, 5 pairs of slacks – yes, there’s definitely room to trim. It would be interesting to visualize this further. Graph theory can help me figure out if there are clothing combinations that will help me simplify my wardrobe, and it might be fun to plot colours and perhaps usage. Hmm…

Other resources:

One Pingback/Trackback

  • Wow! This is fantastic! :) I totally love it! Fashion + Computer Geek = Totally Awesome! Haha

  • Marcus

    Awesome idea. I would not need to depend on the bad taste of my neighborhood anymore. I cannot distinguish several shades of green, assistance as yours would be awesome and (more important) geeky :-)
    I’d advice you to place a white object (sheet of paper) on the side of your clothes. It will enable software to white balance by defining the brightest object as white.
    Cropping the background: Does your camera support manual aperture? You could blur the background when taking the picture. Using GIMPs auto selection tool (magic wand) would be fine if the background is solid and homogeneous shade.

    • The wall is white (or reasonably so), so I used that to whitebalance most of my pictures. Because there isn’t much distance between the clothes and the background, it’s hard to keep the clothes in focus, blur the background, and not risk blurring parts of the clothes as well (shallow depth of field)… If I were going to take pictures of everything again, I’d probably try to see if I can find some kind of stand so that I can move the clothes out a little bit from the background, then light the background with a flash. =)

  • Bhargav V

    I wanted to do this as a Java Midlet on my phone (6 years back) ! Never got around to start! Wish I had your energy!

    • What you call energy, I call laziness. I got tired of trying to recognize patterns in text. ;)

  • Now that you have inspired me, I am going to do this as an Excel + VBA application!

  • Pingback: My evolution as an “artist”, or why there’s hope for you yet » sacha chua :: living an awesome life()

  • bshyong

    This is awesome! Is it open source?

    • Yup! See the footer for a link to the source. =)