2

I enjoy drawing diagrams by hand, either on paper or on a whiteboard. I would like to be able to take photos of these (using either a cellphone or a DSLR) and easily process them into reasonably professional-looking png files that I can post on my blog.

That is, I want to turn this:

enter image description here

into this:

enter image description here

with the minimum of fuss.

I did this one using Photoshop and Lightroom, but it was surprisingly hard and time-consuming to get the backgrounds to come out pure white without making any of the lines illegible. Since I'm planning to do this on a daily basis I would like it to be as much of a one-click thing as possible.

It seems that "Microsoft Office Lens" might be the kind of thing I need, but it's not available on a Mac.

These are the features I'm looking for:

  • runs on Mac (required)
  • crop and rotate (required)
  • make the background pure white, even if there are shadows, without losing detail in the lines (required)
  • make the black lines as close to pure black as possible without losing detail (required)
  • preserve coloured lines (required)
  • correct perspective distortion (desirable)
  • good UI that makes the whole process as streamlined as possible (required)
  • tools for managing and organising converted images (desirable)

A free solution would be ideal, but I don't mind paying for a good one.


Edit: I found, after a bit of experimentation, that I can get decent results quite quickly in Adobe Lightroom, as long as I take a bit more care about how the board is lit. (In my office, that means making sure the desk lamp isn't casting a shadow, and rotating the board so that it faces the window a bit more.) This means that my need for special software is less urgent, but it would still be helpful if someone knows something designed for this purpose, that runs on a Mac.

In case any future visitors would like to know, my Lightroom workflow is something like this. This is assuming a photo taken with a DSLR with good lighting and no perspective distortion.

  1. apply "enable profile corrections" under "lens corrections" (to remove vignetting)

  2. set the white balance using the eyedropper tool, on whichever part of the white background is most in shadow

  3. under "basic", click "auto"

  4. move the whites right up to +100 and the blacks right down to -100

  5. adjust exposure so that the background is 100% white. (You can check by mousing over it - the RGB values are displayed underneath the histogram.) It should be just exposed enough to make all of the background pure white.

  6. if the black lines look faded, increase the contrast until it looks okay, re-adjusting the exposure if necessary

  7. if you can't get it to look good across the whole board because part of it is in shadow, set up a linear filter to increase the exposure in the shadowed part of the board

  8. if the colours don't look good, increase 'vibrance' and/or saturation until they do.

This seems to work quite nicely as long as the original photo is lit reasonably evenly. My only issue with it so far is that it distorts some of the colours, tending to make orange look yellow, for example. (This can probably be corrected easily enough using the 'Color' panel, but that's an extra step.) I was able to get through 20 images or so pretty quickly, by using the sync changes feature for all but the last few steps.

2 Answers 2

1

Here's a self-answer, though hopefully not the one I'll go with in the end.

Github user lelandbatey has created a simple command-line script that cleans up photographs of whiteboards. It requires ImageMagick to be installed (which is easily done via Macports or Homebrew). The result on my example image is acceptable but not perfect:

enter image description here

It will need some cropping and adjustment in an external application of course, but that's okay. The main issues are that it didn't handle the red lines very well (they came out fine on the lower diagram but not on the one I was trying to convert), or the filled black areas, which have become hollow outlines.

Still, it did do a good job of making the background white without creating artefacts. While I'd prefer a graphical app with a well-designed UI I might be able to work around these issues, especially if I can work out a good way to integrate the script into my Lightroom workflow.

0

Your supplied images appear to be well suited to being created by a vector graphics program. Vector images are not various colored dots, but are more accurately portrayed as instructions for creating shapes based on points, angles, and distances, loosely speaking.

The Mac appears to have a good following for a program called Sketch 3 priced at US$50.00 from my recent research. I've also noted a number of questions posted to the graphics design stack exchange forum directly related to the Sketch program.

My search also found a set of tutorials based at the web site https://www.learnsketch.com/ that may be helpful to determine if the program is suited for you. It's likely that the program will also enable tracing a bitmap image to create a vector file, which is more useful when re-sizing such images.

No detail is lost when using vector images, nor is there distortion created, unless operator intended.

Many of your desired features are a matter of the programmer incorporating them into the software and is unrelated to the type of image management (vector vs. raster) and would require some evaluation with the program once installed.

I'm a fan of Inkscape, which is free and has many supporters on the 'net, both in terms of YouTube tutorials and StackExchange posts/answers. Inkscape is also available for the Mac.

I don't know if I can stuff images in comments, hence this edit.

Inkscape will do bitmap tracing. A quick check for Sketch shows that either it never had that feature or that it did and has since been removed. That's a bit short-sighted on the part of the developers, but that's an opinion, of course.

This image is a combination of a screen cap from this site, obviously a low resolution graphic (bottom) and the resultant bitmap trace performed by Inkscape (for Windows, my Mac is shut down).

mac trace test 1

You can see some details were lost in the red color, as I did not attempt to change from default settings to improve the conversion for this test.

mac trace test 2

With the node tool selected, you can see the vectors cluttering up the image at this level of zoom.

mac trace test 3

At the low resolution of the screen capture, some straight lines and sharp angles might have become curved and curves, but it appears that just a few clicks may give you the desired results.

I can't attest to this program operating exactly the same on the Mac as on Windows, but it's probably not much of a stretch to expect that it will.

7
  • Can I clarify: are you saying that Sketch and Inkscape have tools for automatically tracing a photo into a vector format, and that they would perform effectively on my input image? Or are you suggesting I give up on creating the image from a photo and just draw it in Sketch/Inkscape instead? If the latter then that's not what I'm looking for. (I am relatively skilled in Illustrator etc. already, but it takes me an order of magnitude longer to draw a diagram that way, and my goal is to quickly an easily produce a good image from an existing photo of the whiteboard.)
    – N. Virgo
    Commented Jan 28, 2018 at 2:04
  • Added images and updates to the original answer. Please see above. I know what you mean about trying to create a vector image from a blank page. I'm not relatively skilled in AI, nor in Inkscape and use pencil and paper fo rmost of my sketches. Thanks to your question, I may have a more effective method of imparting my work to graphics form!
    – fred_dot_u
    Commented Jan 28, 2018 at 2:20
  • Thanks, that's helpful. Does it work from the first image in my post? (The first image is my original photo of the whiteboard. I made the second one by processing it in photoshop and Lightroom, but that took quite a bit of time and effort, which is what I'm trying to avoid.)
    – N. Virgo
    Commented Jan 28, 2018 at 3:01
  • I suspect that the original higher resolution photo would work better than any attempt I might make with a screen capture from this forum. The settings within Inkscape allow one to make adjustments specific to thresholds that would enable improved results from a photo. It might be more practical to take shots of each segment, close up to get faster processing and even better results.
    – fred_dot_u
    Commented Jan 28, 2018 at 3:37
  • The question is about "Turning photos of diagrams into [...]" so please delete the first paragraphs that talk about creating diagrams, or at least put them at the end. Also, the sequence of actions withing Inkscape would help. Thanks! :-)
    – Nicolas Raoul
    Commented Jan 29, 2018 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.