How much traffic do you get from a viral YouTube video?

Last month, the team from Realm Pictures built an incredibly clever “interactive real-life first-person shooter” that strangers could play over Chatroulette, Omegle, and Skype. In the behind-the-scenes video, they talk about how they pulled off the feat, and it’s an impressive example of unifying a bunch of different technology to accomplish something novel.

Before the video went live, the head of the studio sent me a really nice email about the project, and he mentioned that they used one of my free, CC-licensed songs for the end game sequence. With the email, he also sent a generous donation, and per the “attribution” part of the CC license, he also linked to my site from the YouTube video description. This is a perfect example of how CC licenses are supposed to work, and I couldn’t be happier about the way they used and attributed my work.

Over the next week, the video’s popularity exploded, garnering eight million views within a week, and being featured everywhere from #1 on Reddit to dedicated segments on traditional news outlets. I couldn’t be happier for the team over at RP, and it was a lot of fun to see my music being shared in exactly the way I always hoped: as a free soundtrack for new, creative projects built on a budget.

Projects like this are a poster child for the Creative Commons movement, and its ability to bring artists together in a far less restrictive way than the traditional copyright movement. But I wondered – with Dave and his studio doing absolutely everything right regarding a CC license, including attribution and a link to my work right there on the YouTube page, how many people did it actually send to my site?

I don’t have a financial stake in my CC-licensed music (it’s all free to download and/or use), so traffic and downloads don’t matter, except to provide warm, fuzzy feelings about my work actually being used instead of rotting away on my hard-drive. So my interest in traffic was purely motivated by curiosity. Out of 8,000,000 views, how many people clicked the “Show More” button and followed the link to this site: 1 in 10? 100? 1000?

After checking my logs (which may not be perfect, obviously), the final referred total was…

85 visitors from the viral video itself…
…and 13 more from the behind-the-scenes video.

I have no idea if these numbers are typical for a “viral” YouTube video. I imagine a ton of the views come from embedded instances, where the descriptive text isn’t shown, or perhaps from dedicated YouTube apps, where descriptions may not work the same way. (And even on the main YouTube page, appearing below the fold makes a huge difference.) Additionally, since my music doesn’t really appear in the video – it was more important for the people actually playing the game – there wouldn’t be much incentive for viewers to follow the link in the first place.

What’s interesting to me is that the traffic totals are actually very close to simpler YouTube videos that use my work, like this cute little guy, which has way less views, but in its first year, sent almost identical visitor counts my way:

Anyway, I thought those visitor counts were interesting. I know there’s been some discussion about the effect of YouTube on the music industry, especially with the explosion of “Let’s Play” and other videos that make extensive use of background music, especially CC-licensed tracks like mine. I hadn’t seen hard numbers on referral traffic discussed elsewhere, so now there’s at least one data point!

(Also, many thanks to the team at Realm Pictures for using my work in such a fun project, and for making perfect use of the associated Creative Commons license. Check out more of their work at their website.)

This site - and its many free downloads - are 100% funded by donations. Please consider a small contribution to fund server costs and to help me support my family. Even $1.00 helps. Thank you!

Site overhaul coming – apologies for broken links and other bugs

tl;dr: Mobilegeddon (who thinks up these names?) has finally provided the kick I need to get this site overhauled. Apologies in advance for things like messed up formatting and randomly broken links.

I first threw together tannerhelland.com on WordPress 2.0. To give you an idea of what life was like back then (2006), the release notes for WP 2.0 included such amazing features as “rich editing” and “image uploading”. Be still my soul.

At the time, I was looking to move from a custom-built blog engine to something a little more maintenance-free. I was experimenting with PHP for the first time, and as part of preparing for “Web 2.0”, it seemed like a good language to know. (Aren’t buzzwords like “Web 2.0” hilarious in retrospect?) So I hacked together a Frankenstein WP theme, and added a bunch of custom code to handle my typical blog posts, including automated download links for things like code samples and music.

In the years since, those custom code bits have come back to haunt me, especially with the underlying code being written by a PHP beginner. I can’t easily move to a new platform without dealing with my various custom link and formatting generators, and I keep putting off the task because I don’t want the headache of fixing my old code.

But last week, I got a notification that the site had passed a million pageviews, which was kind of a fun symbolic mark… but also a reminder of “oh crap I am still terrible at this blog thing,” as evidenced by a full year passing since I’ve posted anything new. This is unfortunate, as I’ve been doing a lot of neat work on my open-source photo editor, the kind of work I think would be helpful to talk about in more detail. My latest project is parsing font files and converting glyphs to standard Windows GraphicsPath objects, which has been both fun and terrifying, and if my adventures could save some other poor soul the time and effort of reverse-engineering Stygian APIs like Uniscribe, I’d love to write more about it.

Anyway, all this, combined with the need for a responsive site design, has motivated me to finally deal with my terrible old WordPress code. There’s no easy way to do this, and I’ve coded long enough to know that things are going to break no matter how much testing I do, so thanks in advance for your patience with a semi-working site over the next few weeks.

I hope the end result is a much simpler, mobile-friendly site design, and even fewer barriers standing in my way of talking about weird (and hopefully interesting) new projects. In the meantime, if you need to download a code sample or mp3 or anything else but the link is broken, you can let me know from the PhotoDemon contact page (which won’t be affected by the current overhaul).

Simple algorithms for adjusting image temperature and tint

I’ve already talked at length about converting a temperature (in Kelvin) to an RGB triplet. But what if you simply want to adjust an image’s temperature, without caring about the specifics of it?

Here’s how:

Given a temperature adjustment on the range -100 to 100,
 apply the following adjustment to each pixel in the image:

r = r + adjustmentValue
g = g
b = b - adjustmentValue

As with any additive RGB adjustment, you’ll need to manually clip the output values to the [0, 255] range.

Here’s a sample of the output, as implemented in the latest development build of my open-source photo editor. Note the temperature slider at the bottom of the screen. Because I find the -100 to 100 range to be a bit too strong, I actually divide the adjustment value by 5, thus limiting the actual adjustment value from -20 to 20:

temp_tint_base_image
Base image, courtesy of http://en.wikipedia.org/wiki/Great_wall
Temperature at max value (+20)
Temperature at max value (+20). Note the warmer tones.
Temperature at min value (-20)
Temperature at min value (-20). Note the cooler tones.

Pretty simple!

Because temperature and tint adjustments are usually provided together, here’s the code for basic tint adjustments. It’s even simper than temperature:

Given a tint adjustment on the range -100 to 100, 
 apply the following adjustment to each pixel in the image:

r = r 
g = g + adjustmentValue
b = b 

Sample output, using the same sample image from above (note the tint slider at the bottom):

Tint at max value (+20).  Hard to tell as the image is already very green, but the green has actually been ramped up further.
Tint at max value (+20). Hard to tell as the image is already very green, but the green has actually been ramped up further.
Tint at minimum value (-20).  Note the magenta color cast.
Tint at minimum value (-20). Note the magenta color cast.

This might be the simplest image processing algorithm I’ve ever posted… :)

PhotoDemon 6.2 beta live – testers welcome!

(Apologies for the dearth of blog posts over the past few months. The holidays always throw off my schedule, and it takes some time to get things back in order. I’ll try to make more time for articles!)

A new version of PhotoDemon includes an overhauled interface, lots of new tools (including cool things like Content-Aware resize), WebP and JPEG-XR support, and so much more.  Get it here.
The latest version of PhotoDemon includes an overhauled interface, cool new tools (like Content-Aware resize), WebP and JPEG-XR support, and so much more. Get it here.

A new version of PhotoDemon is about ready to release, and anyone who can help give it a final round of testing is most appreciated. Download the 6.2 beta here:

http://www.photodemon.org/downloads/PhotoDemon_6.2_beta.zip

The announcement article on photodemon.org contains a full run-down of all the new features, but let me mirror a few here for the curious:

Brand-new interface

PD_6-2-beta

The old MDI “floating-window” interface is gone for good. In its place is a sleek, lightweight tabbed interface.

Color-Managed Workflow

Color_Managed_Workflow

This was a huge project, and an exciting addition for both casual and professional users. PhotoDemon now provides a fully color-managed workflow across the entire program (including the main viewport, all tool dialogs, and even small things like color selection dialogs).

New color selector

PhotoDemon_Color_Selection

Major improvement over the stock Windows color selection dialog (which hasn’t changed in 20 years). Many thanks to the open-source photo editor GIMP, whose color selector served as the primary inspiration for this one.

Comprehensive Resize options

PhotoDemon_Resize_Dialog

In past versions, PhotoDemon always required you to resize images using pixel values – but no more! All resize dialogs (Image Resize, Canvas Resize, etc) now support resizing by pixels, percent, or physical units (inches, cm).

All-new JPEG export dialog

PhotoDemon_Export_JPEG_Final

PhotoDemon_Export_JPEG_Final_Metadata

As the most common image format, JPEGs deserve special consideration. PhotoDemon’s new JPEG export dialog provides many new features, including the ability to have the software automatically determine an appropriate quality setting for you.

WebP and JPEG-XR support (import and export)

I don’t know if anyone uses these formats, but they’re there if you need ’em!

New Autosave feature

PhotoDemon_Autosave_Dialog

New Content-Aware Resize tool

Initial image, courtesy of Wikipedia (http://en.wikipedia.org/wiki/File:Broadway_tower_edit.jpg).
Initial image, courtesy of Wikipedia (http://en.wikipedia.org/wiki/File:Broadway_tower_edit.jpg).
Image resized using a standard resize algorithm.  Note the undesirable stretching.
Image resized using a standard resize algorithm. Note the undesirable stretching.
The same image, resized using a content-aware algorithm.  Uninteresting features (like sky and grass) have been shrunk preferentially, leaving the interesting features (person, castle) intact.
The same image, resized using a content-aware algorithm. Uninteresting features (like sky and grass) have been shrunk preferentially, leaving the interesting features (person, castle) intact.

Content-aware resize is a cutting-edge technique for resizing images without distorting their contents. It was recently added to PhotoShop in version CS4, and nearly all free photo editors lack a comparable tool – but not PhotoDemon!

Improved tool previews

updated vignetting tool

Tool dialogs now provide an option to toggle between “fit whole image on screen” and “show image at 100%”. When showing the image at 100%, the image can be click-dragged, so even large images can be fully inspected. Also, the preview tool now supports “click to set a center point” behavior when relevant.

Asynchronous image metadata handling

Parsing image metadata occupies a huge chunk of the image load process. To improve performance, metadata handling is now completely asynchronous, meaning it will operate in parallel with the rest of the image loading process.

Improved Screen Capture tool

PhotoDemon_Screenshot_Dialog

Individual program windows can now be selected from a list, with or without their window decorations (titlebar, borders, etc).

And lots more…

Check out the official beta announcement at photodemon.org for a full list of updates and improvements.

PhotoDemon 6.0 is now live at photodemon.org

The final splash screen for version 6.0.  Thank you again to all the talented contributors that made this release possible!
The final splash screen for version 6.0. Thank you again to all the talented contributors that made this release possible!

After a successful (and relatively bug-free!) beta testing session, PhotoDemon 6.0 has been deemed “ready for mass consumption”. Normally this is where I would put a download link, but let me instead refer you to the new home of all things PhotoDemon: photodemon.org

I thought it was finally time for PD to get its own online home, and photodemon.org is the result. The site still has a few pieces left to assemble (most notably the Features section, which is only about half done), but I didn’t want that to delay the availability of 6.0’s release.

You can download version 6.0 from the “Downloads” section of the new site, or from this direct link:

Download PhotoDemon 6.0 (.zip file, 6.3 mb)

Functionally, this release is very similar to the 6.0 beta that launched two weeks ago. The primary changes from the beta are miscellaneous bug fixes, performance improvements, and cosmetic adjustments.

If you are upgrading from version 5.4, you’re going to notice a lot of new things! You can get a full write-up of all the improvements here, or if you’re in a hurry, here is the abbreviated list of updates:

  • All tools now support save/load presets, reset to default, randomize, and automatic save/load of last-used settings.
  • Italian language support.
  • Vastly improved support for non-US locales and non-English users.
  • Advanced selection tools, including rectangular, elliptical, and line selections.
  • All selection types now support feathering, live move/resize, interior/exterior/border types, and antialiasing.
  • Selection actions are fully integrated into Undo/Redo, and selections can be saved to disk.
  • Full preservation of all types of image metadata (EXIF, XMP, IPTC, etc). Metadata can be browsed via a new metadata browser.
  • Official RAW image format support; more than 20 RAW filetypes are now supported.
  • Three new blur tools: motion, radial, and zoom blur. Also, big improvements to Gaussian and Box Blur.
  • A new chroma key (“green screen”) tool with performance comparable to professional tools, including full support for edge blending.
  • New Perspective tool, with support for forward and reverse transforms.
  • New Photo Filter tool, with support for 50 digital photo filters (Wratten-type).
  • New Curves tool. Supports adding, moving, and removing an unlimited number of nodes.
  • New Channel Mixer tool.
  • New Canvas Resize tool.
  • New Spherize tool (for wrapping images around spheres).
  • New Vibrance tool.
  • New Pan and Zoom, Poke, Shear, and Squish distortion tools.
  • A new Language Editor for translators.
  • New variable-strength Sharpen tool.
  • New Oil Painting tool.
  • Many improvements to the Batch Wizard, including dedicated options for batch resizing.
  • Minor improvements to many tools, including polar coordinate conversion, wave distort, ripple distort, figured glass, tile image, posterize, rotate, custom filters, histogram, resize.
  • Any tool with a “color” option now allows you to pick a color directly from the image by clicking the preview.
  • Much better support for high-DPI screens, including tablets.
  • Support for transparent clipboard images, allowing you to move layered images between GIMP and PhotoDemon.
  • Filters and other long-running actions can now be canceled mid-action by pressing ESC.

Acknowledgments

This 6.0 release represents six months of hard work from a variety of contributors. While I am very grateful to all of PhotoDemon’s talented contributors, a few deserve special mention. Thank you to:

  • Audioglider for contributing three new tools: Channel Mixer, Vibrance, and Exposure. Audioglider also reported a number of issues, and motivated me to implement preset support for every PD tool.
  • Frank Donckers for again providing the German, French, and Dutch translations, and for contributing many pieces of code to the new Language Editor, including the Google Translate interface. Amazing stuff.
  • GioRock for the Italian translation, and for detailed testing of many small translation items. It takes a ton of work to get all of PD’s text translating properly, and GioRock debugged many items for me, which benefits users of every language.
  • Kroc Camen for a new IDE-safe mouse interface class, derived from his own open-source VB project. Kroc also reviews many of PD’s individual commits, where he catches many small items I overlook.
  • Robert Rayment for helping me profile and optimize a number of PD’s more taxing functions, and for many suggestions on tweaks and improvements. Many of the performance improvements available in this new version are a result of Robert’s help. Please check out his own VB image editor if you can.

Enjoy!

I hope you enjoy version 6.0. If you have any feedback, please send me a message. I’d love to hear from you.

 

This site - and its many free downloads - are 100% funded by donations. Please consider a small contribution to fund server costs and to help me support my family. Even $1.00 helps. Thank you!

PhotoDemon 6.0 beta is live

Chroma key (green screen) is one of many new tools in this release.
Chroma key (green screen) is one of many new tools in this release.

Download

Remember: if you’re an advanced user, you never have to wait for a beta release. You can always download PhotoDemon’s latest development release from its GitHub page (source code), or from this nightly build permalink (program only).

PhotoDemon is funded by donations from users like you.
Please consider a small donation to fund development and to help me support my family.
Even $1.00 helps. Thank you!

Overview

It’s taken nearly six months, but PhotoDemon 6.0 is finally ready for release. I’ve already talked about some of the great features this release includes, like powerful selection tools, metadata (EXIF) support, Curves and other new tools, so I’d recommend glancing through the linked article if you’re curious.

Since that article, a number of other features have been added or improved:

  • All tools now support save/load presets, reset to default, randomize, and automatic save/load of last-used settings. These items are all accessible from a new “command bar” at the bottom of each tool dialog.
  • From left-to-right, the command bar includes buttons for: reset, randomize, saved presets, and save current settings as preset.  Last-used settings are automatically saved and loaded by the dialog.
    From left-to-right, the command bar includes buttons for: reset, randomize, saved presets, and save current settings as preset. Last-used settings are automatically saved and loaded by the dialog.
  • Three new blur tools: motion, radial, and zoom blur. These tools outperform similar tools in GIMP and Paint.NET.
  • PhotoDemon's new radial blur tool is 4x faster than Paint.NET's, and 30x faster then GIMP's - and at high angles, it produces significantly better output.
    PhotoDemon’s new radial blur tool is 4x faster than Paint.NET’s, and 30x faster then GIMP’s – and at high angles, it produces significantly better output.
  • Much faster Gaussian and Box blur tools (20x improvement!)
  • The updated Gaussian Blur tool now provides quality settings for improved performance.  For most photos, the difference between "good" and "best" will be indistinguishable, but "good" will be some 20x faster.
    The updated Gaussian Blur tool now provides quality settings for improved performance. For most photos, the difference between “good” and “best” will be indistinguishable, but “good” will be some 20x faster.
  • A new chroma key (“green screen”) tool with performance comparable to professional tools, including full support for edge blending. Find it in the Image -> Transparency -> Make color transparent menu.
  • Before color removal; image courtesy http://dimula73.blogspot.com/2013/03/new-user-interface-for-krita-color-to.html
    Before color removal; image courtesy http://dimula73.blogspot.com/2013/03/new-user-interface-for-krita-color-to.html
    After color removal.  Note that the tool creates a 32bpp image, which you can then composite using any photo editing software.
    After color removal. Note that the tool creates a 32bpp image, which you can then composite using any photo editing software.
  • A new Language Editor makes contributing new translations fast and easy.
  • The new Language Editor makes it easier than ever to get involved in translation.  Please contact me if you can help!  (You will receive full credit for your work.)
    The new Language Editor makes it easier than ever to get involved in translation. Please contact me if you can help! (You will receive full credit for your work.)
  • New variable-strength Sharpen tool
  • Previously, PhotoDemon only provided set "Sharpen" and "Sharpen More" functions.  The new tool allows for floating-point adjustments, which allow for much more nuanced fixes.  (Unsharp Masking is still available too, obviously!)
    Previously, PhotoDemon only provided set “Sharpen” and “Sharpen More” functions. The new tool allows for floating-point adjustments, which allow for much more nuanced fixes. (Unsharp Masking is still available too, obviously!)
  • New Oil Painting tool
  • Same photo as the screenshot at the top of this page, but oil-ified.
    Same photo as the screenshot at the top of this page, but oil-ified.
  • Minor improvements to many tools, including polar coordinate conversion, perspective correction, wave distort, ripple distort, figured glass, tile image, posterize, rotate, custom filters, histogram.
  • The perspective tool now supports both forward and reverse transforms.  Reverse transforms allow you to simply trace a crooked object, and have it automatically straightened by the program.
    The perspective tool now supports both forward and reverse transforms. Reverse transforms allow you to simply trace a crooked object, and have it automatically straightened by the program.
    The histogram offers new render options, which can be helpful for identifying areas of channel overlap.
    The histogram offers new render options, which can be helpful for identifying areas of channel overlap.
  • Any tool with a “color” option now allows you to pick a color directly from the image by clicking the preview.
  • Much better support for high-DPI screens, including tablets.
  • Faster viewport rendering for 32bpp images.

Again, these new features are only a fraction of what 6.0 includes. Please check out the 6.0 preview article for news on all the other new tools and improvements.

Acknowledgments

This 6.0 release represents six months of hard work from a variety of contributors. While I am very grateful to all of PhotoDemon’s talented contributors, a few deserve special mention. Thank you to:

  • Audioglider for contributing three new tools: Channel Mixer, Vibrance, and Exposure. Audioglider also reported a number of issues, and motivated me to implement preset support for every PD tool.
  • Frank Donckers for again providing the German, French, and Dutch translations, and for contributing many pieces of code to the new Language Editor, including the Google Translate interface. Amazing stuff.
  • GioRock for the Italian translation, and for detailed testing of many small translation items. It takes a ton of work to get all of PD’s text translating properly, and GioRock debugged many items for me, which benefits users of every language.
  • Kroc Camen for a new IDE-safe mouse interface class, derived from his own open-source VB project. Kroc also reviews many of PD’s individual commits, where he catches many small items I overlook.
  • Robert Rayment for helping me profile and optimize a number of PD’s more taxing functions, and for many suggestions on tweaks and improvements. Many of the performance improvements available in this new version are a result of Robert’s help. Please check out his own VB image editor if you can.

Known bugs

  • EXIF data is not maintained with certain combinations of preferences (delay loading EXIF + export full data when saving). This is caused by a metadata caching issue, and will be fixed by release. Fixed!
  • ExifTool plugin is slightly out of date. It will be updated to its latest version upon 6.0’s release. Fixed!
  • Metadata menus sometimes become disabled even when metadata is available. This will be fixed by release. Fixed!
  • OK and Cancel buttons are not currently translated. This will be fixed by release. Fixed!
  • Some hotkeys don’t fire unless the main form is first clicked. This is a known problem with VB, and will hopefully be fixed by release. Fixed!
  • Master language file is missing a few minor text entries. This will be fixed by release.

The beta version was released before these small items were fixed, so it still contains these bugs. Developers can download updated source code, with these fixes, from GitHub.

Official release timeline

Barring any major bugs, the official 6.0 release should happen within several weeks. Feature-wise, it will be identical to this beta release. The only changes will be minor bug fixes and performance improvements. Automatic update notifications for existing PhotoDemon installs will also go live at that point.

Blur Filter performance: PhotoDemon vs GIMP vs Paint.NET

(Note before I begin: the PhotoDemon 6.0 beta should be live by the end of this week. Sorry it took so long to prepare!)

See what kind of fun charts we get to discuss?  And here I thought the days of 17-minute photo editing actions died with the Pentium III...
See what kind of fun charts we get to discuss? And here I thought the days of 17-minute photo editing actions died with the Pentium III…

The latest nightly build of PhotoDemon (download it here) includes a bunch of new and improved blur filters. Blur filters are among the most computationally demanding filters in a photo editor, because for each pixel in an image, a bunch of other pixels must also be examined in order to calculate the blur. (Blurs generally work by averaging together groups of pixels. Motion blur averages pixels in a line, radial blur averages pixels in an arc, and normal blur averages pixels in a box or circle shape.)

As a simple example, consider a basic blur with a 200 pixel radius, applied to a 10 megapixel digital photo. For each pixel in the photo (all ten million of them), an area of 200 pixels in each direction must be averaged together. Using a simple box blur, that means a box of 200 pixels left, right, up and down must be tallied (for a net area of 400 * 400, or 160,000 pixel comparisons) in order to calculate the blur. Thus, such an algorithm would require:

10,000,000 pixels * 160,000 calculations per pixel = 1.6 trillion total calculations

Even on a modern processor, that’s an enormous undertaking. Fortunately, mathematicians and coders have developed many clever ways to optimize blur functions. Many of these optimizations appear in the newest PhotoDemon build, so I thought it would be fun to speed-test four of PhotoDemon’s blur tools against two other free photo editors: GIMP and Paint.NET. The results were surprising enough that I thought them worth sharing.

A brief overview of each photo editor:

  • PhotoDemon: open-source, written in VB6, nightly build 893 (6.0 beta)
  • GIMP: open-source, written primarily in C, v2.8.6
  • Paint.NET: closed-source, written primarily in C# (and the .Net framework, per the name), v3.5.11

As benchmarking goes, this was very informal. PhotoDemon reports timing automatically in nightly builds, but for GIMP and Paint.NET I had to resort to using a stopwatch. Normally this is a terrible idea, but the algorithms involved take a very long time to run, so a stopwatch was sufficient for broad timing. (10ths of a second don’t matter much when an algorithm takes twenty minutes to finish…)

All tests were done on Windows 7 (64-bit), on my Core i5 650 (3.2ghz) desktop PC with 8gb of RAM. My PC was middle-of-the-road when I bought it back in 2010, so I’d consider reasonably representative of an “average” PC. All the tools in question appear to be heavily CPU-bound anyway, so it’s doubtful newer processors or more cores would make a meaningful difference.

The test photo I used was a 10 megapixel photo, 3872×2592 specifically, in JPEG format:

10 megapixel test photo

With the exception of some very long timings (10+ minutes), all timings were checked twice to make sure results were representative. Very long ones were only checked once due to the wait involved, though I did initiate a second attempt just to make sure my PC wasn’t acting up. (It wasn’t.)

Here are the timing results for four separate blur types, with some notes on my implementation, and what I know or can potentially infer about GIMP and/or Paint.NET’s implementations.

(Due to the large size of the images involved, I saw no reason to upload the output images of each test. Anyone interested can easily reproduce this test on their own PC with images of their choosing.)

Gaussian Blur

Two notes - PhotoDemon used the "good" quality setting, which is a Gaussian estimation using a modified 3x box blur, and GIMP used the IIR method.
Two notes – PhotoDemon used the “good” quality setting, which is a Gaussian estimation using a modified 3x box blur, and GIMP used the IIR method.

Gaussian Blur provides an excellent starting point. Gaussian blur works by averaging a square chunk of pixels, and giving pixels close to the center more weight than pixels far away. It is the most common type of blur tool in photo editing software, probably because its results are aesthetically pleasing, and it is an easy blur function to optimize.

Instead of a naive approach, which would involve the 1.6 trillion calculations mentioned above, most photo editors implement Gaussian Blur using a separable implementation, which cuts the calculations to a much more pleasant 8 billion calculations. Unfortunately, 8 billion calculations is still a lot. (PhotoDemon’s “best quality” option on its Gaussian tool applies a pure Gaussian using separable kernels. On large images, it’s slow. Very slow.)

An even faster approach takes advantage of a neat mathematical relationship between box filters and Gaussian filters: if you keep applying a box filter to a set of data, the result will eventually approach a Gaussian distribution. (Excellent charts available here, courtesy of Nghia Ho.) The Central Limit Theorem shows that repeating a box blur three times results in a function that’s ~97% identical to a true Gaussian.

PhotoDemon uses this as the basis for its three quality settings for Gaussian blur (good, better, and best). Good is a 3x box blur approximation, Better is a 5x, and Best is a true Gaussian. For the chart above, I used the “good” setting because it is by far the fastest. (Note that there’s a bit more to it than just repeating a box blur – how you calculate the box blur size matters; I use a variation of the W3 recommendation available here.)

Take-home message: GIMP’s IIR implementation is excellent – very fast, and it produces a true Gaussian, no estimations. PhotoDemon is surprisingly competitive for a single-threaded VB6 app. Paint.NET’s Gaussian is quite poor both in quality and final result. Its resulting blur is muddier than a true Gaussian, and much slower than you’d expect for a box-blur approximation… so I honestly have no idea how they’ve implemented it.

Motion Blur

PhotoDemon used "Quality" mode instead of "Speed", meaning bilinear interpolation was applied to the rotated image.  No extra options are available for this tool in GIMP or Paint.NET.
PhotoDemon used “Quality” mode instead of “Speed”, meaning bilinear interpolation was applied to the rotated image. Also, “blur symmetrically” was checked. No extra options are available for this tool in GIMP or Paint.NET.

Motion blur is a bit more problematic than Gaussian blur, because it doesn’t work in a square pattern. A naive approach would have you use something like Bresenham’s algorithm on each pixel, tracing a line at the specified angle and averaging interpolated values as you go.

A much better approach is to simply rotate the image by the requested angle, apply a (very fast) horizontal blur, then rotate the image back into place. If you use a fast rotation algorithm (like the famous 3-shear technique), this can make motion blur very quick.

My PhotoDemon implementation does not use the fast 3-shear technique; it uses a naive, geometric rotation (reverse-mapped) with bilinear interpolation. I expected this to make it quite a bit slower than comparable tools in GIMP and Paint.NET, but I was surprised to discover that both software packages are… well, pretty damn terrible.

Based on a brief perusal of GIMP’s source code, they appear to use the naive Bresenham approach, which explains why it’s so slow.

Once again, Paint.NET’s execution time makes no sense to me. For a software package that claims: “extensive work has gone into making Paint.NET the fastest image editor available“, methinks they need a bit more “extensive work” on this particular tool…

Radial Blur

As before, PhotoDemon uses the "quality" setting for bilinear interpolation.  Paint.NET was applied at quality setting 2 out of 5, the default setting.  (This results in a noticeably lower-quality image than PhotoDemon or GIMP.)  GIMP does not provide any additional options for this tool.
As before, PhotoDemon uses the “quality” setting for bilinear interpolation. Paint.NET was applied at quality setting 2 out of 5, the default setting. GIMP does not provide any additional options for this tool.

And so we move to Radial Blur, where we find a surprising role reversal: Paint.NET gives a much better showing here, while GIMP turns in the worst performance yet. Again, a brief look at GIMP’s source code for this function shows a questionable nested-loop approach to the problem. Tracing an arc-like path for each pixel is a bad idea, and while bilinear interpolation is used to improve the output quality – same as PhotoDemon – the time required makes this tool pretty much unusable.

PhotoDemon’s implementation is nothing particularly special, which makes its relative performance so surprising. I use a well-known trick where I convert the image to polar coordinates, apply a horizontal blur, then convert the image back to Cartesian coordinates. A small amount of image quality is lost by the two coordinate conversions, but because we are blurring the image anyway, this doesn’t matter much. That said, for small angles (< 5 degrees), both GIMP and Paint.NET produce better-looking output. At larger radii, however, PhotoDemon's is much better. Both GIMP and Paint.NET produce Moire patterns, presumably from sampling at discrete intervals, while PhotoDemon’s output is clean and smooth. This can probably be fixed in Paint.NET by using a higher quality setting, but quality setting 2/5 was already slow enough!

The top-left corner of the image after PhotoDemon's radial blur.  Buttery smooth, and accurate edge handling.
The top-left corner of the image after PhotoDemon’s radial blur. Buttery smooth, and accurate edge handling.
Same corner, but from Paint.NET's radial blur.  Nasty Moire patterns, and problematic handling in the corner - from an algorithm that took 4x longer to run.
Same corner, but from Paint.NET’s radial blur. Nasty Moire patterns, and problematic handling in the corner – from an algorithm that took 4x longer to run.

Zoom Blur

No, that huge green bar is not an error.  GIMP took a whopping 17 minutes to render a 200px zoom blur.  PhotoDemon's "traditional" mode was used to provide comparable output.  Paint.NET does not offer any specialized options for this tool.
No, that huge green bar is not an error. GIMP took a whopping 17 minutes to render a 200px zoom blur. PhotoDemon’s “traditional” mode was used to provide comparable output. Paint.NET does not offer any specialized options for this tool.

Last up is Zoom Blur, and we have a surprising winner! Paint.NET’s zoom blur implementation is excellent – great quality, very fast, and overall a huge improvement from their other blur tools. I have no idea why Zoom Blur is significantly faster than their Gaussian Blur implementation at a comparable pixel size, so I can only assume that some kind of specialized optimizations have been added. Nice work, Paint.NET team!

GIMP… I don’t even know what to say. It’s possible that I triggered some sort of problem with GIMP’s tile-based processing system, because there is no good way to explain a 17-minute processing time for such a straightforward function. Even a naive implementation shouldn’t take anywhere near that long. Their implementation has loops nested five-deep (dear god), and while bilinear interpolation is used to improve output, that algorithm is so poorly written that I frankly think they should consider removing it completely. Even at very low distances, rendering takes forever. The original copyright date on the source file is 1997, so perhaps someone familiar with GIMP’s internals should give this one a second look.

PhotoDemon uses the same trick here as with radial blur. The image is converted to polar coordinates (with swapped x and y values compared to the radial blur conversion), a horizontal blur is applied, then the image is converted back. Again, there is quality loss at low values, and both Paint.NET and GIMP provide better-quality output at very small radii. To mitigate this, I provide a second style on that dialog, which uses an iterative image-sized alpha blend to generate a blur. One of the neat things about that approach is that the image can be zoomed-out as well as zoomed-in.

I doubt there is a legitimate use for zoom-blur-outward like this, but it wasn't any extra work to implement.  :)
I doubt there is a legitimate use for zoom-blur-outward like this, but it wasn’t any extra work to implement. :)

Conclusions

Blur algorithm performance is hugely variable in both GIMP and Paint.NET. I’ll admit – I find it a bit amusing that my little PhotoDemon project, written with a 15-year-old programming language and compiler, outperforms them so handily in multiple areas, despite my implementations being generally lazy, single-threaded, and heavily CPU-bound. I also call “bullshit” on Paint.NET’s claim about “extensive work going into making Paint.NET the fastest image editor available.” I think the Paint.NET team does great work, and their software is a wonderful improvement over many free and paid photo editors, but its performance is greatly lacking in a number of areas.

Then there is GIMP. While I am very grateful for their software, and have learned to love its many quirks, there’s no denying that whole swaths of its source code are in desperate need of a revamp. I imagine there is no point revisiting items like blur until they complete their migration to GEGL – perhaps then we will see big improvements in the performance of these various blur functions.

If there’s a take-home message to all this, it’s that algorithms will always be more important than programming languages. A well-written algorithm in a “slow” language will often outperform a poorly written algorithm in a “fast” language. VB6 may be forgotten and nearly dead, but I’m happy to see it staying competitive with the titans of the “free photo editor” world. :)

If you read the article all the way to here, I hope you’ll give PhotoDemon a look:

http://www.tannerhelland.com/photodemon/#download

For a free, open-source photo editor, it has a lot of nice features, and I can empirically state that it outperforms GIMP and Paint.NET in at least a few areas! (The current nightly build is pretty much how the next stable release (6.0) will look, minus a few minor bugfixes still to complete.)

How to compile zLib 1.2.8 (WINAPI / WAPI / STDCALL version)

This is not a full-blown article – just a quick HOWTO for people who require the latest version of zLib and want to use it from a language (like classic VB) that requires a standard WinAPI interface.

By default, zLib uses C calling conventions (CDECL). Gilles Vollant has helpfully provided an STDCALL version of zLib in the past, but his site only provides version 1.2.5, which dates back to January 2012. zLib is currently on version 1.2.8.

Gilles has contributed his WAPI fixes to the core zLib distribution so that anyone can compile it themselves. To do this, you will need to download:

Once both of those are downloaded (and updated, as VS 2012 will require you to install several service packs), follow these steps to compile zLib yourself:

  1. Extract the entire zLib file and navigate to the /contrib/masmx86 folder. Open the “bld_ml32.bat” file in a text editor.
  2. Add the “/safeseh” switch to both lines in that file (e.g. “ml /safeseh /coff /Zi /c /Flmatch686.lst match686.asm”). Then save and exit.
  3. Navigate to the /contrib/vstudio/vc11/ folder. Open the zlibvc.sln file in your newly installed Visual Studio 2012 Express.
  4. In the Solution Explorer (top-right by default), right-click “zlibstat” then select “Properties” at the bottom.
  5. Go to Configuration Properties -> C/C++ -> Preprocessor, and in the Preprocessor Definitions line remove “ZLIB_WINAPI;” (don’t forget to remove the trailing semicolon).
  6. Now, we need to fix a recently introduced problem that relies on Win8 functionality. In the Solution Explorer, navigate to zlibvc -> iowin32.c. Double-click to open the file.
  7. Find the line of text that reads “#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)”. Change this line to “#if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY_DESKTOP_APP, WINAPI_PARTITION_APP)”. (Thanks to this link for this fix.)
  8. zLib uses a Version number declaration that can cause the build process to fail. To fix this, go back to the Solution Explorer, then navigate to zlibvc -> zlibvc.def. Double-click to open.
  9. Change the line that reads “VERSION 1.2.8” to read “VERSION 1.28”.
  10. Finally, go to the Build -> Configuration Manager menu and change the Active Solution Configuration to “Release”.
  11. Exit that window and press F7 (or click the Build -> Build Solution menu). The project should successfully build.
  12. You can find your newly compiled zlibwapi.dll file in the /contrib/vstudio/vc11/x86/ZlibDllRelease/ folder.

PhotoDemon 6.0 preview and progress report

PhotoDemon's new splash screen.  I'd say this is a "huge" improvement over the old one, but that might be understating it... :)
PhotoDemon’s new splash screen. I’d say this is a “huge” improvement over the old one, but that might be understating it…

overview

It’s been awhile since I posted any news on PhotoDemon, but not because work has slowed – just the opposite, in fact! The development version of PD is cranking ahead full-steam, and thanks to a number of outside contributors, the next version will include a wider set of improvements than any previous version. There’s still quite a bit of testing and fine-tuning to do, so this article does not include a downloadable beta release – rather, the article is meant to serve as a preview of the upcoming 6.0 release and all the cool new features it provides. (Of course, developers or anyone with access to Visual Basic 6.0 can compile the latest version themselves by visiting PhotoDemon’s GitHub page. New testers and contributors are always welcome!)

First, an explanation on why the next PhotoDemon release will be version 6.0 instead of the expected 5.6. The next release will break backward compatibility with a number of PhotoDemon files, including any saved macros or filters. This break is necessary to implement a large overhaul of PhotoDemon’s internals – an overhaul that makes the program faster, smaller, more stable, and much easier to develop and maintain. The goal is to have all of PhotoDemon’s specialized file formats (including macros) use XML for storage. This allows both users and other software developers to read and edit PhotoDemon files from any general-purpose text editor. This change will also make it much easier to add new macro features without breaking old macro files. (The current macro format was developed over a decade ago, when the program was only meant for personal use, and it is extremely flimsy and difficult to extend – hence the need for a redesign.)

The downside of this change is that any current macros will need to be re-recorded in version 6.0, as version 4.X and 5.X macros will no longer be supported. I apologize for this inconvenience, and I promise to do my best to avoid breaking backward compatibility in the future.

The 6.0 release will also include important interface changes – such as a redesigned main menu and tool window – further supporting the switch to a new major version number, and for developers, the program’s central action processor has been redesigned from the ground up, making it easier than ever to get involved in development.

So with that out of the way, let’s talk about the good stuff, namely: what’s coming in 6.0? Here is a list of features and updates that are already finished and available in the current development build (again, downloadable at https://github.com/tannerhelland/PhotoDemon).

Italian language support

Courtesy of talented contributor GioRock is a new Italian language option for PhotoDemon. Many thanks to GioRock for this huge contribution.

Other internationalization improvements

With the help of GioRock and Frank Donckers (you may remember Frank as the brilliant developer behind PhotoDemon’s language translation engine), a number of other improvements are now available for international PhotoDemon users:

  • The comma “,” is now supported as a decimal separator in all tools. Previously, use of a comma could lead to critical errors.
  • Translated text is now automatically resized if it is larger than its tool window. This helps text in verbose languages remain fully readable.
  • Translations that span multiple lines (such as long tooltips) are now automatically handled by the program. This reduces the burden on translators to manually fit translated text longer than its English equivalent.
Here is the Options panel in full Italian.  The text of the bottom checkbox on the right-hand panel originally extended past the edge of the dialog, but PhotoDemon has detected that and shrunk the text accordingly.  This requires no work on the part of the translator!
Here is the Options panel in full Italian. The text of the two checkboxes on the right-hand panel originally extended past the edge of the dialog, but PhotoDemon has detected that and shrunk the text accordingly. (This required no work on the part of the translator!)

New feature: advanced selection tools

The new elliptical selection tool, with live feathering (feathering is the softened selection edges).
The new elliptical selection tool, with live edge feathering.

PhotoDemon 6.0 includes a completely redesigned selection tool engine. At present, the following dedicated selection tools are available:

  • Rectangular and Square selections (with optional rounded corners, including variable corner radii)
  • Elliptical and Circular selections
  • Line selections: unique to PhotoDemon, this tool allows you to select a line-shaped area, very helpful for things like tilt-shift effects (see below)
PhotoDemon's line selection tool was combined with Gaussian Blur to simulate this fake miniature photograph of the city of Jodhpur.  (Photograph and concept taken from this Wikipedia article.)
PhotoDemon’s line selection tool was combined with Gaussian Blur to simulate this fake miniature photograph of the city of Jodhpur. (Photograph and concept taken from this Wikipedia article.)

Each selection tool supports the following features:

  • Live selection coordinate and size display
  • On-canvas resizing by click-dragging nodes
  • Selections can be nudged or moved via text entry
  • Shift can be held to lock a 1:1 aspect ratio (e.g. squares or circles)
  • Live smoothing options: none, antialiased, or variable radius feathering (live feathering is only available on Windows 7)
  • Live selection types: interior, exterior, or bordered, with live border radius selection

In addition to these dedicated tools, a new Selection menu is available with additional selection-related features.

PhotoDemon's new Select menu
PhotoDemon’s new Select menu
  • Select All and Select None
  • Invert Selection (switch selected and un-selected pixels, with full feathering support!)
  • Grow/Shrink Selection
  • Border selection, which takes the current selection and selects only its border
  • Feather and sharpen selection
  • Load and save selections

Thanks to the selection engine redesign, these features will automatically work with future selection tool implementations, including polygon/free-draw and “magic wand” selections.

Another huge improvement is integrating all selection actions into the Undo/Redo engine. If you create, move, resize, or apply any other action to a selection, you can now Undo/Redo that operation.

Selections are now fully integrated into the Record Macro tool.

Copy and Crop now support selections of any shape, making it trivial to crop circular or rounded-rectangle regions, or copy them for use in another program. (Feathered selections are automatically converted to 32bpp images, with the feathering applied in the alpha channel.)

Finally, the core Selection tools have been rewritten to use vector coordinates. This means that selections loaded from file are automatically resized to fit the current image, making them extremely useful for Batch Processing operations.

New image metadata (EXIF, XMP, IPTC) support

PhotoDemon now includes the marvelous ExifTool project as an optional plugin. ExifTool is the most comprehensive image metadata handler currently available, and PhotoDemon makes full use of its ability to handle every known type of image metadata, from the popular EXIF format (used in JPEGs) to obscure maker notes for all major DSLR brands.

PhotoDemon's new custom-built Image Metadata browser.  This image is a RAW-format file from an Olympus DSLR.  ExifTool allows us to peruse all the custom Olympus data entries.
PhotoDemon’s new custom-built Image Metadata browser. The metadata in question comes from a RAW-format photo taken with an Olympus DSLR camera. Note that ExifTool allows us to peruse all the non-standard Olympus data entries.

A new integrated metadata browser automatically sorts metadata by category, and it allows the user to see actual or human-friendly metadata tags. The browser fully integrates with ExifTool’s multilanguage capabilities, sparing translators from any extra work!

When saving images, the Preferences manager now provides options for metadata embedding:

PhotoDemon's new metadata handling preferences.
PhotoDemon’s new metadata handling preferences.

Unique to PhotoDemon is a privacy-centric metadata option, which aims to remove any personally identifying metadata entries, like serial numbers or GPS coordinates. By default, the “preserve all relevant metadata” option is recommended, which will remove any metadata not relevant to a file format (such as removing maker notes when saving RAW files to JPEG), but retain all other metadata entries. Metadata can also be fully stripped from exported files.

Also fun is a new Image -> Metadata -> Map GPS Coordinates option, which becomes available if an image contains GPS data. This option will automatically map the photo’s location in Google Maps.

New tools: too many to mention!

As always, the next release will include a host of new image editing tools. Here’s a small sampling of the latest additions to PhotoDemon’s repertoire:

PhotoDemon's new interactive perspective correction tool.  Drag the corner nodes to re-visualize the image in real-time, allowing you to do things like fix crooked buildings, as in this photograph from a recent trip to San Francisco.
PhotoDemon’s new interactive perspective correction tool. Drag the corner nodes to re-visualize the image in real-time, allowing you to do things like fix crooked buildings, as in this photograph from a recent trip to San Francisco.
PhotoDemon's new Photo Filter browser.  To my knowledge, this is the most comprehensive collection of post-production Wratten filters in any software, ever.  The interactive photo filter browser provides 50 custom-built photo filters for fixing every possible lighting situation.
PhotoDemon’s new Photo Filter browser. To my knowledge, this is the most comprehensive collection of digital Wratten filters in any software, ever. The interactive photo filter browser provides 50 filters, allowing you to make an infinite number of post-production lighting adjustments.
PhotoDemon's new Curves tool.  It supports unlimited curve points, a live histogram overlay, removal of points by right-clicking them, and fully antialiased curve rendering.  In my opinion, this is the loveliest tool in the program, and the loveliest Curves dialog of any mainstream photo editor.
PhotoDemon’s new Curves tool. It supports unlimited nodes, removing nodes by right-clicking, a live histogram overlay, and fully antialiased curve rendering. In my opinion, this is the loveliest tool in the program, and the loveliest Curves dialog of any mainstream photo editor.
PhotoDemon's new Channel Mixer.  This tool comes courtesy of outside contributer audioglider, who contributes multiple tools to this release - please shower him with praise!  (The subject of this photo is the latest addition to my family, a beautiful Australian Shepherd / Shetland Sheepdog mix named Yosuke.)
PhotoDemon’s new Channel Mixer. This tool comes courtesy of outside developer audioglider, who built multiple tools in this release – so please shower him with praise! (The subject of this photo is the latest addition to my family, a beautiful Australian Shepherd / Shetland Sheepdog puppy named Yosuke.)
PhotoDemon finally includes a Canvas Resize tool.
PhotoDemon finally includes a Canvas Resize tool.
PhotoDemon's new Sphere tool lies more in the "Fun" category than the "Practical" one, but that's okay.  For a bit of extra style, the program can render matching background rays onto the canvas, as shown in the screenshot above.
PhotoDemon’s new Sphere tool lies more in the “Fun” category than the “Practical” one, but that’s okay. For a bit of extra style, the program can render matching background rays onto the canvas, as shown in the screenshot above.

For sake of brevity, I’ll forgo images of the rest of the new tools, namely:

  • Max/min channel
  • Pan and zoom
  • Poke
  • Shear
  • Squish
  • Vibrance (developed by audioglider)

Other improvements and additions for end-users

PhotoDemon's batch wizard now includes dedicated options for common batch operations, such as resizing.  The wizard has also been further streamlined to make batch processing as easy and quick as possible.
PhotoDemon’s batch wizard now includes dedicated options for common batch operations, such as resizing. The wizard has also been further streamlined to make batch processing as easy and quick as possible.
The Resize Tool has undergone a significant redesign.  Resampling options are now human-friendly, and several how-to-fit options are now provided when changing an image's aspect ratio.  This makes it possible to resize images to a new aspect ratio without unsightly distortion.
The Resize Tool has undergone a significant redesign. Resampling options are now human-friendly, and several how-to-fit options are now provided when changing an image’s aspect ratio. This makes it possible to resize images to a new aspect ratio without unsightly distortion.
When flattening an image with transparency (alpha channel), you can now select a background color.  Previously the software always defaulted to white.
When flattening an image with transparency (alpha channel), you can now select a background color. Previously the software always defaulted to white.
  • Transparent images can now be copied/pasted between PhotoDemon and other software. This means you can take an image with multiple layers in GIMP and paste it into PhotoDemon fully composited.
  • Official RAW image format support; more than 20 RAW filetypes are now supported.
  • 30-40% speed improvements to Gaussian Blur, Smart Blur, and Unsharp Masking thanks to an Integer-only rewrite of the blur engine.
  • Filters and other long-running actions can now be canceled mid-action by pressing ESC.
  • Revamped main window interface, as you can see in the screens above. The left-hand toolbar is now images-only, while the right-hand one has been expanded.
  • Better validation for all text controls. Invalid entries are automatically circled in red.
  • Alt+T will now let you switch between preview and non-preview modes in all tools.
  • Many miscellaneous bug fixes, optimizations, and other improvements. For a full list, see the commit log at https://github.com/tannerhelland/PhotoDemon/commits/master

Improvements and additions for developers and contributors

  • PhotoDemon can now provide timing reports for all actions passed through the central software processor. Simply enable the DISPLAY_TIMINGS constant when compiling.
  • New custom slider/text and up/down controls make it easy to utilize PD’s existing validation and translation abilities in your own tool dialogs.
  • A new string-based filter parameter class makes it easy to tie complex tools with many parameters into the software processor (and thus into recorded macros). No longer do you have to convert param lists to complex custom Variant embeddings.
  • PhotoDemon now includes a high-performance font rendering class, which makes custom font rendering (with AA) much easier to implement.
  • Dev builds, including build number, are now automatically detected by the program, making it easy to see which build you’re currently working with.
  • Support tools, including the custom plugin compressor and master translation file generator, are now synched to GitHub in the /Support subfolder.
  • A public histogram-generation routine is now available, so you can tap into PhotoDemon’s highly optimized histogram generator for any of your own tools.

Contributors, developers, and translators still welcome!

As always, PhotoDemon can never have enough external contributors, developers, and translators. If you can help with any aspect of the 6.0 release, don’t hesitate to get in touch. Many features in the 6.0 release wouldn’t be possible without outside help, and I’d love to add you to the ever-growing list of talented contributors that make PhotoDemon possible!

If you can’t contribute with coding or translations, donations are another great way to help. Thanks in advance for your small monetary contribution to this completely open-source project, which provides a full-featured photo editor (comprising 60,000 lines of code and more than 50,000 words of translated text in five languages) completely free of charge.

Where does Microsoft make money? (Updated 2013)

(Past reports here: 2012, 2011, 2010, 2009)

Introduction

As in past years, all information in this report is taken from Microsoft’s publicly available 2013 10-K filing. Numbers may vary from past reports. When Microsoft moves products between revenue categories, they retroactively adjust the totals for past years so that year-to-year comparisons are accurate. This article uses 2011 and 2012 values as calculated in the 2013 report. All values are in USD.

If you’ve read my past reports, feel free to skip down to the charts. If this is your first time here, let me provide a quick explanation of how Microsoft breaks down its earnings.

Microsoft 2013 earnings tl;dr (“too long, didn’t read”)

  • Microsoft remained highly profitable in 2013, with solid year-over-year growth in both revenue and operating income.
  • The Business (Office) division brings in significantly more money than the Windows division (+30% revenue, +70% profit). In fact, nearly half of Microsoft’s 2013 profits came from the Business division alone.
  • For the first time ever (to my knowledge), the Windows division was actually 3rd in revenue in 2013, behind both Business and Server/Tools. If trends from the past four years continue in 2014, Server and Tools will pass Windows in not just revenue, but profitability as well.
  • Regardless of division, the vast majority of Microsoft’s profits come from business and OEM sales. Consumer-centric divisions (including XBox, Windows Phone, Bing) are largely irrelevant from a profit standpoint.
  • Just for fun: in 2012, Apple pulled in double the revenue of Microsoft ($156 billion USD and $74 billion, respectively). Source 1, Source 2.

Overview

Microsoft is unique among tech companies for reporting detailed information by product line. Their competitors do not provide such a detailed breakdown; Apple, most notably, is organized around “functional” divisions rather than “product” divisions, making direct financial comparisons between Apple product lines and Microsoft product lines difficult.

This year, Microsoft announced a company-wide reorganization plan that would bring them closer to Apple’s structure. Many (myself included) have doubts about this resulting in meaningful changes to Microsoft’s overall structure and performance, but there is one area the reorganization is almost certain to impact: financial reporting. Sadly, this means that 2013 may be the last year I am able to provide detailed earnings charts by product division.

There are many theoretical benefits to organizing a company by “function” instead of “products.” One benefit is reduced infighting between product groups, a known problem for Microsoft. Another benefit is the ability to hide losses due to underperforming products. Microsoft had its share of those in the past year, most notably its billion-dollar loss on the Surface RT line of tablets, the impact of which can be seen in the charts below.

Microsoft Total Revenue and Operating Income (June 2012 – June 2013)

Total Revenue: $77,849,000,000
Operating Income: $26,764,000,000

Long story short: for all their failings, Microsoft remains hugely profitable.
Long story short: despite some big missteps in 2013, Microsoft remains very profitable.

Total Revenue is the total amount of money Microsoft takes in from normal business operations.

Operating Income is calculated as “Operating Revenue – Operating Expenses”. In other words, Operating Income is the profit made from normal business operations. (A more detailed definition is available from Investopedia: “Operating income would not include items such as investments in other firms, taxes or interest expenses. In addition, nonrecurring items such as cash paid for a lawsuit settlement are often not included. Operating income is required to calculate operating margin, which describes a company’s operating efficiency.”)

Operating Income is particularly important when looking at a company like Microsoft. Certain Microsoft divisions take in a great deal of money, but they also require much higher costs to operate. Thus it is relevant to look at not just how much money a certain division brings in, but at how efficiently that division generates its revenue.

Microsoft Revenue and Operating Income by Division (June 2012 – 2013)

Microsoft products (and earnings) are divided into five divisions: Windows, Microsoft Business, Server and Tools, Entertainment and Devices, and Online Services. The types of products and services provided by each segment are as follows.

(Note: these divisions are pretty much identical to 2012, with the exception of Microsoft’s $1.2 billion purchase of Yammer and its corresponding addition to the Microsoft Business division.)

Here are the 2012-2013 revenue and operating income values for each division, in USD. Note that the number in parentheses is the percentage change between 2012 and 2013.

Windows (including Surface tablets and other hardware)
Revenue: $19,239,000,000 (+5%)
Operating Income: $9,504,000,000 (-18%)

Business (Office, Exchange, SharePoint)
Revenue: $24,724,000,000 (+3%)
Operating income: $16,194,000,000 (+2%)

Server and Tools (Windows Server, Microsoft SQL, Visual Studio)
Revenue: $20,281,000,000 (+9%)
Operating Income: $8,164,000,000 (+13%)

Entertainment and Devices (XBox 360/LIVE, Windows Phone)
Revenue: $10,165,000,000 (+6%)
Operating income: $848,000,000 (+120%)

Online Services (Bing, MSN, Hotmail)
Revenue: $3,201,000,000 (+12%)
Operating income: $-1,281,000,000 (*)

(* – Microsoft had an artificially huge loss in the Online Services division in 2012, due to a one-time goodwill impairment charge of $6.2 billion. This makes year-to-year comparisons meaningless.)


Microsoft Total Revenue – 2013

MS_2013_revbydivision_USD
Microsoft total revenue in 2013, in USD.

 

MS_2013_revbydivision_percent
Same chart as above, but with percentages.

Microsoft Operating Income – 2013

Microsoft operating income, by division, for 2013. (Amounts in millions USD.) Note that Online Services represents a $1.2 billion dollar LOSS.
Microsoft operating income, by division, for 2013. (Amounts in millions USD.) Note that Online Services represents a $1.2 billion dollar LOSS.

Year-over-year comparisons (2010-2013)

Microsoft revenue by division for the years 2010-2013. Overall revenue continues to trend upward, despite flat Windows sales.  Note that as of 2013, both Office and Server/Tools brought in more money than Windows.
Microsoft revenue by division for the years 2010-2013. Overall revenue continues to trend upward, despite flat Windows sales. Note that as of 2013, both Office and Server/Tools brought in more money than Windows.

 

Microsoft operating income by division for the years 2010-2013. Unlike revenue, operating income varies dramatically from year to year. Microsoft Business has now dominated profits for three straight years, and if trends continue, Server and Tools will surpass Windows in profitability next year.  Note also how irrelevant XBox and Windows Phone (E&D) are from a profit standpoint.
Microsoft operating income by division for the years 2010-2013. Microsoft Business has now dominated profits for three straight years, and if trends continue, Server and Tools will surpass Windows in profitability next year. Note also how irrelevant XBox and Windows Phone (E&D) are from a profit standpoint.