Best tool for adding markup/annotations to images

I’ve started working on documenting our application. So I need to take screenshots of the windows, add them to a document, and write up what each window does. A useful and necessary part of that is a fast tool that lets me annotate an image with arrows and text. Maybe some rectangles. But nothing sophisticated.

The critical aspect is that you never get it right the first time. Or you change the layout of the application window and you need to redo the documentation. If you have to redo all the markup every time the layout changes, you are dead.

So what tool lets you open an image, create a new layer, add text and arrows to the layer, then save the document keep the layers separate so that you can replace the old image with a new image down the road? You also want to be able to select that text, change it and move it, and re-align the arrows.

Tools I considered:

  1. Gimp
  2. ShareX
  3. Paint.net
  4. Inkscape

The tool has to be obvious, because I might go away a year before I come back and have to work on it again. I am going to forget how to do it.

  1. Anyone who has tried to add a rectangle in gimp runs into a WTF: Why is it so difficult and non-obvious? There is no tool to “create a rectangle”. Instead you have to “select a rectangle” then “Fill selection outline”. I’ll never remember that. And it is hard too. Google how to add arrow plugins. I can do all that but it will take me hours to recall all the nuances. Sorry, I gave up after a few hours of crappy results.

  2. ShareX is fast and has excellent basic tools to do what I need. Unfortunately, once you save the file, all the work is lost. No layers. No way.

  3. Paint.net is excellent and fast. The only weakness is that objects are blended into the image as soon as you hit Enter. So you need lots of layers and will have to redo each layer when you re-edit. Doable.

  4. Inkspace does the job properly. Not trivial, and I am going to have trouble remembering how to get back to it (hence this post). But it has layers and keeps everything as Objects.

instantfield

I’ll get better but here are the basics:

  1. Start by importing an image. You can link or embed. Choose embed. Go to Document Properties and select “Resize to Content”.
  2. Create a single bezier curve with an arrow. Create some text. Make sure they are the same color.
  3. It is faster to copy and paste existing text and arrows than it is to get all the settings right over and over. If there is a way to make these values, I have yet to learn.
  4. Once you copy and paste the new values, editing is weird.

    a. For the Text, type the letter “T”. Then click on the text object. Then type new text.

    b. For the arrow, type the key “F2”. That puts it into an edit mode where you can click and move the start and end points.

For assembling the document and building the html (or pdf), I am using asciidoctor. I could not get the Eclipse plugin to manage complex nested documents. VS Code or IntelliJ-Community works ok.

Gimp batch mode with gmic

For photo work, I use Aurora HDR 2019 and Gimp. Within Gimp, I use the GMIC plugin a great deal, as it has the best noise reduction and hot pixel reduction.

The one big weakness of Gimp is lack of batch mode. You cannot record some action on an individual image, then save that action and apply it to a group of images.

And I do a lot of work on groups of images.

There is a heavy duty script processing engine in gimp, but I find it inaccessible. And I’m a programmer! The basic problem is that I am a lazy programmer and I really don’t need another language unless I really need another language.

Well there is BIMP for batch Gimp operation.

I’ve done practically no BIMP. The basic operations that BIMP provides I can can do in Irfanview.

Well I found myself needing to remove the hot pixels of a few hundred photos. The gmix function is remove_hotpixels. But this is the first time I have seen this documentation and the example is confusing. After reading this I thought I needed to write:

+remove_hotpixels _mask_size=3, _threshold=10,

And I tried many many options and nothing worked.

However, some of the simpler commands worked, so I knew it was just a matter of finding the right syntax.

This post is to record what worked. The image below shows the successful Bimp settings. (Except the input field would not expand.)

The function name is plug-in-gmic-qt

The input layer is something besides 0 (holy crap, that just generated out with no changes whatsoever and was a real pita to figure out)

The output mode is 0. Maybe some other options work but 0 works.

The command line string is “remove_hotpixels 3 10“, where 3 is the mask size and 10 is the threshold.

Don’t use a “plus” or “minus”. Don’t name your arguments

Well that is it so far. Another inch of knowledge.

 


Update from 2020:

 

Well, I have given up trying to run batch gmic from within gimp. Too much of a hassle, too iffy, and far too slow.

Instead, I installed gmic, the command line tool. You can find it at https://gmic.eu/download.html.

Better to have a horrendously hard to figure out uphill battle from the command line than the same thing from within a clunky gimp dialog.

The positive from using a command line is that we have well known tools for iterating over multiple files. This is important because the “iterating over multiple files” part of the gmic command line doesn’t seem to exist. I can only figure out how to write a gmic script to read one file and write one file.

I can’t yet even figure out how to tell gmic to read a jpg and write a tiff.

But the “remove hit pixels” command is (on a windows platform, using “cmd”):

for /r %f in (.\*) do gmic %f ^

-remove_hotpixels 3,10,,,Merged ^
-o %f

From the command line, cd to the folder containing the files you want to convert and paste the above text. It will recursively find all files in this folder and all sub-folders. It will open each file, run the “remove hotpixels 3,10” command, then save over the same file. And it will do it orders of magnitude faster than the same thing in gimp with bimp.

I also find anisoptropic smoothing to be very useful. It is a nightmare trying to find the right combination of arguments to a gmic command. The best way  is to setup the command in gimp then alter the settings to display the arguments. Still a pita, as you have to eyeball the text and re-type it into the command line; copy-paste does not work.

Here is a starting point for anisotropic smoothing:

for /r %f in (.\*) do gmic %f ^
-fx_smooth_anisotropic 80,0.7,0.3,0.6,1.1,0.8,30,2,2,0,1,0,0,50,50 ^
-o %f

The actual settings are listed here, but good luck converting the argument types to the integer command line values.

 

Not sure where the best documentation and tutorials for gmic are. Everything I have found requires you to know what everything means before being able to do anything. More notes added here as I learn.

 

https://manpages.ubuntu.com/manpages/trusty/fr/man1/gmic.1.html

http://gimpchat.com/viewtopic.php?f=10&t=19008

https://gmic.eu/tutorial/

Gimp ‘dust and scratches’ filter

Photoshop (and Elements) has a terrific filter called Dust and Scratches. It looks for dots and curves on the image that are clearly noise, then removes them. This comes from dust on your lenses or on the photos you’re scanning, etc. An invaluable tool for all image cleanup work.

No such thing in the Gimp world. Search for gimp + dust + scratches and you either find the despeckle filter (which is useless, ime), or references to some 3rd-party plugin which was never compiled for windows.

The best tool I know of comes from the G’MIC plugin for Gimp. This is a must-have tool for many reasons (e.g., making lady’s portrait skin look soft and smooth), but the Remove Hot pixels option under the Repair subset is essentially the same thing as the Dust and Scratches of Photoshop.

I have not read the technical documentation, but the controls are simple: Mask size is the number of pixels at which to consider something being a “hot pixel”. Too low and you miss pixels. Too high and you lose detail in the image. Threshold is the amount of difference to require for something to be considered “hot”. Too high and you won’t change anything. Too low and you change too much. A standard approach is to start with mask size and threshold at minimum, then increase mask size until you fix all/most of the errors, then increase threshold until you stop screwing up everything else. Tip: As this is a compromise, leave the big scratches for manual work: Use the Clone and Healing tools instead.

Here is an example of a BEFORE ==> AFTER.

UPDATE: January 2016

As of the latest G’MIC plugin for Gimp, this effect has been moved to “Repair -> Remove hot pixels”

Also, try the “Repair -> Iain’s noise reduction”