Multipoints not saving in JPG format


I am a new user of ImageJ (version 1.53a on a Windows computer). I am using the multipoint tool to count ducks and classify them based on sex and age. I am trying to save a simple JPG of the finished image per my boss’s request, but every time I try all I get is the original photo with the grid I overlayed, no points at all. I tried “flattening”, but that appears to do nothing with the points (which I believe have to do with ROI?).

Another less serious, but annoying problem-- the undo/Ctrl-Z doesn’t seem to work for anything. This resulted in me counting 400 ducks twice over. What the heck am I doing wrong?!


Hello Louise -

I’m guessing that you are not converting your selection (ROI) to
an overlay before you flatten. Try running (from the Fiji / ImageJ
menu bar):

Image > Overlay > Add Selection...

It works for me.

Here is an ImageJ Macro (IJM) that pretty closely tracks the
by-hand gui commands:

newImage("Untitled", "8-bit noise", 256, 256, 1);
makeSelection("points small yellow hybrid", newArray (50, 50, 100), newArray (40, 60, 60));
run("Add Selection...");
saveAs("Jpeg", "multipoint_flatten.jpg");

And here is the image as stored on disk:


(Note, as a general rule, you should avoid storing your images as
JPGs. It’s a lossy format – to save space – so your JPG image will
have compression artifacts.)

Thanks, mm

1 Like

Thanks, that was it! I knew it would be something small like that!

If anyone has an answer about the Ctrl-Z thing, that would be greatly appreciated, too :slight_smile:.

Hi @Louise_Bishop,

the undo function is not really working as you are used to in other programs. That is a little unfortunate for new users but you get used to.
In case you loose the points you can restore them pressing Shift+E (Restore Selection)
In case you need to delete an existing point, just hold Alt and click on it to remove it from the counter. The rest will be renumbered. Thus, you should be able to add and remove manual counts as needed.

One other question might be, how crowded your images are and if it would even be a possibility to think about an automated counting, if males and females are sufficiently distinguishable e.g. by colors and silhouette against the background. To this end you might want to have a look at ImageJ Principles to get started with feature extraction.

Lastly, just as a tip, I would recommend to not save images in JPEG format for scientific uses. Since JPEG contains visual artifacts. This makes automation often difficult. If the images are taken with a normal digital camera, it might provide the usage of the RAW image format, which can either be read directly bay the Bio-Formats plugin for ImageJ / Fiji or can be converted with the commercial software for that camera. Thus, you keep highest quality as well as additional metadata and a better option for image post-processing.

Thanks so much for the advice!

I think I will start working on trying to automate them in the future, but right now it is not feasible with the images I have.

Thanks again,