labeling and saving transparent layer in photoshop - photoshop

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:
How do I draw on the transparent layer (I am reducing the opacity to
0 because I want a transparent layer, right?)
How do I paint the unlabeled pixels black? (because that is what the program recognizes
as unclassified)
How do I save the transparent layer as a 8-bit image?
Thanks!

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.

Related

Removing white from colored vector image on illustrator

I have a colored image from photoshop where the background is transparent well as some other spots. After using image scan and expand, the transparent background was gone so I reselected the design I made and copied it to another layer. The white background is gone, however, I see that there are still white spots in the design that wasn't transparent.
I selected them and deleted them, but, it gives me black instead of transparent.
I'm out of ideas as to how to make these white spots transparent. The same thing with my signature- although I can erase it completely, if I just erase the white parts, I get black.

Batch resize images with different background colors

My goal is to batch resize images with different background colours.
I already used Photoshop to batch process and centre (horizontal and vertical align) 2000 different images into square 200x200 tiles on a white background (the images are different in size, background colour, and sometimes file-type).
I can process and batch resize the images and place them on a white 200x200 tile using the batch processor and recorded 'Actions'. With transparent .png images, this looks great.
The problem is that some of the images have a coloured background. If an image has a coloured background a white border around the image looks quite awful.
How do I dynamically resize the non-transparent images of different colours and sizes to 200x200 square .jpg images? I can do it manually with the colour-picker but is there another option?
As you can see it is only a problem when images have a coloured background.
Thank you in advance!
Save the following script somewhere convenient:
var myDocument = app.activeDocument;
myDocument.colorSamplers.removeAll();
var myColourSampler = myDocument.colorSamplers.add([1 , 1]);
app.backgroundColor = myColourSampler.color;
At the start of the action your going to use for your batch process, record the opening of the script (File >> Scripts >> Browse...), then go and get the script.
It will take the colour of the top left pixel and set it as the background colour, your action should do the rest

Removing part of image in photoshop

I have this element in my psd layout
I need to remove green rectangle and leave a gray box with a gap at the top (in place of the green rectangle) and save as .png. How can I remove green rectangle?
select Magic Wand Tool (press W on keyboard), then select the
green area and then press Backspace to remove it.
Then Create new Layer with white background and set it as background
layer,
Then create your own gray layer.

How does Photoshop show multi-layer in Normal Blend Mode?

I'm trying to understand how the normal blend mode works in photoshop.
http://www.pegtop.net/delphi/articles/blendmodes/normal.htm
As the webpage says,it just shows the color of the layer above.But when I copy the same layer and show them together,the color seems darker than just show one layer.And when I add more,the color remains at a particular value.
The normal blend mode shows the color of the topmost fully opaque layer, for transparent layers it will add from top down until fully opaque is reached.
This means that if you have a fully opaque red element over any, for example, blue element, the color red will be displayed. If you have a red element that's 50% transparent over a blue element, the color pink will be displayed.
If you have one black element that is 50% transparent it will appear as a medium gray, if you duplicate the layer, the two elements on top of each other will add up to display a complete black.

How to create letterpress effect?

I'm looking to implement something like the famous "letterpress" effect in my application. Here's what I'm talking about: (just a quick example made in PShop)
As you can see, it looks like it's pressed into the background. I wonder if it's possible to do something like this on the Mac dynamically. Is there a way? Thanks!
You can do the gradient fill portion of the text using the code I provide in this answer. Check the coordinate space first, because I described that for the iPhone, which has an inverted Y axis when compared to the Mac's normal Quartz coordinates.
The text is first used to create a clipping path, and the gradient is drawn within that path.
As far as the internal shadow, you might be able to draw this after the gradient is drawn by using CGContextSetShadowWithColor() with an appropriate downward offset and black color, then drawing the text again using just the stroke of the text. deanWombourne has some sample code for a similar task in his answer here.
Draw the text with a normal font to create a black and white bitmap of the text.
Draw another image that is is the same size and completely filled with the gray-to-white gradient you have above.
Create a completely white image with the same size as your other images.
Draw your back and white text image (1) onto the white image (3) with NSCompositeDestinationOut.
This gives you a white image with your text cut out.
Draw the white image with the text cut out on top of the gradient image and apply a shadow while drawing.