This is my first question here and I'm not a graphic designer, just need to change some 'ground truth', as we call it in computer vision to train a conv. neural net.

There is an image, size HxWx3 and its 'ground truth' mask, HxWx1. Ground truth uses just white (for borders) color delineating some objects. I need to change it a little bit, by adding more white borders.

I need to overlay these two images such that both are visible (i.e. some transparency is necessary) and add these changes to the mask. Then I need to save that mask in a separate file.

Sorry if the question's dumb, but I've looked around and haven't been able to implement anything sensible. These are the images, the former is 1000x600x3, the latter (mask) is 1000x600x1:

enter image description here

enter image description here

The best I could manage is this, and this is nowhere what I want; among other things, I couldn't find the way the use white color to draw.

enter image description here

Any help is appreciated


2 Answers 2


These images are not the size you say. The top one is 1280 x 720, and they aren't the same aspect ratio either. However if you can get them the same size, you can open the black image as a new layer above the photograph (using File > Open as Layers).

Then set the layer blending mode to Screen in the Layers panel, making sure you select that Layer. Then you can draw on that layer with the Pencil Tool, with the foreground colour set to white, and the size set to around 2px.

To output the image, hide the bottom layer by clicking the the Layer visibility icon in the Layers panel, and then click File > Export As, to export it in whatever format you want.

enter image description here

  • OK I admit your method is faster. The only thing, I had to change back to 'Normal' before saving, otherwise I got the empty mask. Also, Subtract instead of Screen is slightly more convenient.
    – Alex
    Mar 23, 2018 at 11:42

The solution I found is close to Billy Kerr's. The difference, is that after adding ground truth mask as a layer, I reduced the opacity (in the same box as layers), added the changes with white color and then returned the opacity back to 100 (because otherwise the changes would be grey, switched off the main image and saved the gt mask as a file. The small problem is, though, that these changes often are not 255, but 253, 249, etc. So I'll try Billy's method later!

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.