labeling and saving transparent layer in photoshop

65 views Asked by At

I am a newbie to photoshop. I have some images that I need to label by hand to feed to a machine learning algorithm for classification. The labeling accepted by the code bundle I will be running on is supposed to depict the features I am interested in, and the other unlabeled pixels are to be black. For instance, I have a picture of land, and I will have to paint on it with red to mark the rocks, and blue to mark the soil. The other regions in the picture will be black. SO my labeling image should have red (rock) and blue (soil) and black (unclassified). I am told I need to do this with transparent layer on top of my actual picture, and I can paint on the transparent layer as I want, and save that transparent layer as my label image. My questions are:

  1. How do I draw on the transparent layer (I am reducing the opacity to 0 because I want a transparent layer, right?)
  2. How do I paint the unlabeled pixels black? (because that is what the program recognizes as unclassified)
  3. How do I save the transparent layer as a 8-bit image?

Thanks!

1

There are 1 answers

0
Mark Setchell On BEST ANSWER

1) Anything you draw on a layer with zero opacity will not show! You need an empty layer, not a zero opacity layer. To make this, ensure your Layers palette is visible by pressing F7. Then, at the bottom right corner of the Layers palette, beside the trashcan, select New layer.

2) To paint pixels black, press d for default colours since black is the default colour. Then press B for Brush. Now you can paint on the empty layer. Press [ to make the brush smaller and ] to make it bigger. Click the black foreground colour square on top of the square white background colour in the Tool palette (left side of my picture) to change colours.

3) To save the classification layer only, click on the eye icon in the Layers palette of the other layers that you don't want in order to turn them off. That way only the layer you want will be saved. Then click File->Save for Web and select a file format that supports transparency - i.e. PNG or GIF, but NOT JPEG or TIF.

I have marked in green, all the buttons I mention that you will need to click on.

enter image description here