Adding a photo without a background in gimp. Creating a transparent background in GIMP


Transparency of a layer or background allows you to overlay different parts of an image or merge several images into one. This is the principle of animation in particular. In Gimp, as in other editors raster graphics, you can create new file with a predefined transparent background. You can set the background transparency for already existing file, saved even in formats that do not support it. Finally, you can use different effects based on transparency.

Behind transparency in Gimp The so-called alpha channel responds. Let's consider all three options listed above in their simplest form.

1. Create a new file with a transparent background. Open the menu FileCreate. A window will appear in which you can set all the parameters of the new image. Template and image size are the main parameters. The rest are called by pressing the plus sign next to the phrase Advanced options. Among the advanced options is the Transparent background option. To get to it, click the triangle next to the word Background and choose Transparent. Please remember that the jpg extension does not support transparency.

2. Another option. We already have an image in jpg format is a frame downloaded from the Internet, which for some reason has lost its transparency in the center. What should I do with it? , which must be there so that you can insert a photo inside. It is clear that we need to remove, that is, erase this very middle. Usually she white, therefore, you can use a tool that in Gimp is called Selecting Contiguous Areas, but out of habit left over from Photoshop, it is called with a magic wand. Everything would be fine, but for some reason, instead of the cut out area, the background color still remains. Not transparent. You can correct the situation by adding an alpha channel to the image. So, we choose either top menu, or, in the contextual right-click, Layer - Transparency - Alpha Channel. Now, when you delete any area, the space underneath it becomes transparent.

Now you can safely click the magic wand in the center and press DELETE. The desired transparency will appear in the center of the frame. For greater effect You can shade the selection a little before cutting. For this we choose SelectionShade. Set the required number of raster points or other units. Only then do we carry out the removal operation. Here's what might happen.

Since the selection will not be needed in the future, remove it: SelectionTake off.

3. Finally, let's look at one of the simple but very interesting effects called Map without seams. This filter is also called a seamless transparent background. We use the same frame for work as before. Let's look at the screenshots. Open the file with the frame, select from the menu FiltersMapNo seams. Next we work in the window Layers, Channels, Paths, Undo. If this window is not visible, then activate it and make it visible through the menu item Window.

This article will tell you how to do transparent background images in graphic GIMP editor. Although making a transparent image background in this editor is not difficult for a novice user this editor There may be difficulties in mastering the interface, and, accordingly, with the transparent background of the image. This article tells, among other things, how to carefully cut out part of an image from a selected picture, because in some cases you can make a transparent image background in this way.

GIMP tools and menus for creating a transparent picture background

This article will not cover installation graphic editor GIMP and it is implied that if you are interested in this topic, then you have already installed it. Also, the entire toolbar will not be considered; it is quite large and each part has its own purpose.

The toolbar considers only two tools for creating a transparent picture background:

1. Free selection with arbitrary lines or segments;

2. Identification of adjacent areas by color convergence.

It is in the toolbar that we will need this to make the background of the image transparent.

In the GIMP editor menu itself, we need the file, edit and color item. Moreover, in order to make a transparent image background in GIMP, we don’t need anything. And so let's start adding our image to the graphics editor.

Adding an image to the GIMP graphics editor

To add your image to the GIMP editor for editing and making its background transparent, you can use several options. The first option is to simply drag the image into the main editor window, and the second is to open it from the place where it is located. In the first case, we simply move the cursor over the selected image, click left button mouse and holding it, drag it into the program window. In the second case, in the menu - file, select the item open, and selecting the desired one on your computer graphic file, in the dialog box, click the open button. The file you are editing appears in the editor window and you can make its background transparent.

Two Ways to Make an Image Background Transparent in GIMP

There are two ways to do this GIMP background images transparent is the selection of adjacent areas by color convergence and transfer of the background color to the alpha channel or free selection of the image with arbitrary lines, cutting it out and creating a new transparent image from the clipboard.

The first way to make the background of an image transparent in GIMP

An image in GIMP with a transparent background can be obtained by selecting adjacent areas based on color convergence. To do this, we need an image with a plain background. If the background is not a single color, then you won’t be able to create a transparent image background this way.

1. Open the image in the editor.

2. Select a tool in the toolbar called selecting adjacent areas by color convergence, click on the picture with the image of a magic wand, and then on open image In the editor, click on the monochromatic color of the picture. Solid color will be highlighted

.

3. After selecting a solid color, go to the menu section and select the item - color. In the menu that opens, select the item - to alpha channel. After selecting this item, an approximate view of our picture will be shown in the dialog box.

If you like everything, click OK and assign an image in the editor window that will have a transparent background.

Now, in order for the image to end up with a transparent background, you need to export it to one of the file formats that supports a colorless background. If you save the image in GIF or PNG format, the background colorless effect will be exactly the same. I myself use such image formats, even those that do not necessarily have a transparent background.

The second way to make the background of an image transparent in GIMP

If the image does not have a plain background, then you will have to use the second method to obtain a colorless image. This method is a little more complicated and you may need to get used to it and acquire some skills in using the tool to freely select an image with arbitrary lines. Although skills may be required, in essence there is nothing complicated here. You just need to select the main image along the perimeter, placing points at some distance, and ending at the original point.

After highlighting the image with random lines in the GIMP graphics editor, we have to cut it out and create a new image that will have a transparent background from the clipboard.

To cut out the selected image, we will use the menu item - edit. Click on this menu item and select Cut from the drop-down list. After this, the original image will be without the cut-out image, and the cut-out image will go to the clipboard. It's primitive to say with a hole. If you save this image with a hole in PNG or GIF format, you can use it as a mask for another image in the second layer of one or another graphics editor, and get the appearance of part of the image of the first layer under the mask. Now it's time to create an image from the clipboard with a transparent background.

Creating an image with a transparent background from the clipboard in the GIMP editor

To create an image with a transparent background from the clipboard in the GIMP editor, use the menu item - file, and in it select the sub-item - create. In the sub-item - create, select - from the clipboard. After selecting this item, we will have a new window in the editor with an image that will have a transparent background.

All that remains is to export our image with a transparent background, created from the clipboard, into PNG or GIF format. We managed to make the background of the image transparent in the GIMP editor.

The GIMP program is deservedly considered one of the most powerful graphic editors, and the undisputed leader among free programs in this segment. The capabilities of this application in the field of image processing are almost unlimited. But many users are sometimes perplexed by such seemingly simple tasks like creating a transparent background. Let's figure out how to make a transparent background in Gimp.

First of all, you need to understand which component in GIMP program responsible for transparency. This composite is the alpha channel. This knowledge will be useful to us in the future. It should also be noted that not all image types support transparency. For example, PNG or GIF files can have a transparent background, but JPEG files cannot.

Transparency is required in various cases. It may be appropriate both in the context of the image itself, and as an element for superimposing one picture on another when creating a complex image, and can also be used in some other cases.

The options for creating transparency in GIMP depend on whether we are creating a new file or editing an existing image. Below we will look in detail at how you can achieve the desired result in both cases.

Create a new image with a transparent background

In order to create an image with a transparent background, first of all, open the “File” section in the top menu and select “Create”.

A window appears in which you set the parameters of the created image. But we will not focus on them, since the goal is to show the algorithm for creating an image with a transparent background. Click on the plus sign next to the words “Advanced options”, and an additional list opens in front of us.

In opened additional settings In the “Fill” item, open the list of options and select “Transparent Layer”. After that, click on the “OK” button.

Then, you can proceed directly to creating the image. As a result, it will be located on a transparent background. But just don't forget to save it in one of the formats that supports transparency.

Creating a transparent background for a finished image

However, most often it is necessary to make the background transparent not for a picture created from scratch, but for a finished image that needs to be edited. To do this, again go to the “File” section in the menu, but this time select the “Open” item.

A window opens in front of us in which we need to select the image to edit. After we have decided on the choice of image, click on the “Open” button.

As soon as the file opens in the program, we return to the main menu again. Sequentially click on the items “Layer” - “Transparency” - “Add alpha channel”.

Next, we use a tool called “Selecting adjacent areas,” although most users call it a “magic wand” because of its characteristic icon. The "Magic Wand" is located on the toolbar on the left side of the program. Click on the logo of this tool.

Field of this, click on the background with the “magic wand”, and click on Delete button on keyboard. As you can see, as a result of these actions, the background becomes transparent.

Making a transparent background in GIMP is not as easy as it seems at first glance. An uninitiated user can spend a long time sorting through the program settings in search of a solution, but still not find it. At the same time, knowing the algorithm for performing this procedure, creating a transparent background for images, each time, as you get better at it, becomes easier and easier.

Most often, a transparent background in an image is required to create branding, collages and logos for videos. Titles in a film, graphic memes on the Internet, and, in the end, chromakey technology (a green background when filming a film) also have much in common with transparent background technology.

To perform this task we will use free program Gimp 2.8, which is not inferior in its capabilities to many paid analogues. Let's look at how to make a transparent background in Gimp and how to further use an image with a transparent background.

We have two pictures and we want to make a collage out of them. Place a picture of a penguin on a photo of a tropical beach. Why not. Penguins need to rest too :)

Penguin - symbol of Linux.


Tropical beach is a place where Linux users relax :)

Fast way

Launch Gimp and open both image files.


We begin to move the penguin under the palm tree. Let's use the widely used "Copy" -> "Paste" method. For this:

  • activate the window with the penguin and copy the penguin to the clipboard;
  • then we go through the window with a palm tree Edit/Paste (Ctrl+V) insert an image with a penguin.

Ready. Penguin under a palm tree, but something is wrong. If we simply copy one image on top of the other, we'll see that the white background around the penguin obscures the tropical beach portion of the image. This doesn't suit us. So we need to get rid of white background. Or, in other words, make a background transparent. Then objects from the picture of a tropical coast will be visible through this transparent background.

The right way

A transparent background in gimp is done in several ways, but I will give one as the most reliable and works in any case.

Step 1: Alpha Channel

At the first stage, you need to decide whether the image has an alpha channel. If it does not exist, then it must be created. He will be responsible for transparency. Get used to it right away, if somewhere they talk about an alpha channel, it means transparency and vice versa. Select from the menu Layer/Transparency/Add Alpha

If the alpha channel already exists (the menu is inactive), then there is no need to add anything. If the menu is active (allows you to add), then add an alpha channel to our image.

There is another way to check for the presence of an alpha channel in an image. To do this, open the dockable dialog " Channels", through the menu Windows/Dockable Dialogs/Channels. If the channel list contains " Alpha", then everything is fine and your image is ready to create transparency.

Step 2. Transparency zones

After we have prepared the image for working with transparency (added an alpha channel), we proceed to defining the areas in the image that will be transparent. I marked in the drawing with numbers those areas through which palm trees, sea and sand will be visible.

Selecting zones in Gimp is a separate story, which is not enough for one publication. There are several tools, plugins and many ways to select a group of pixels for further processing. In our case, we will consider the most the simplest way selecting a zone using the "Selecting Adjacent Areas" tool.

This tool operates on the principle of adding to the selected area " All pixels are the same color" around the one you clicked on. In our case with the penguin, this is what we need.

Step 3. Transparent background

Now you're ready to create a transparent background. To do this, press the key Delete and the image takes the form.


What was previously white has become a gray “square”, this is Gimp’s way of showing transparent areas.

Our image with a transparent background is ready. You can burn it to disk for further use, post it on the Internet, send it by mail. This is a normal image and most viewers and browsers do a fine job of displaying it.

Step 4. Write to file

Most often, images with a transparent background are stored in PNG, GIF and TIFF formats. In PNG and TIFF, transparency is implemented through the alpha channel, which is responsible for areas with a transparent background. Using the alpha channel you can make not only a transparent, but also a translucent image. GIF has a slightly different technology; there is no alpha channel and transparency is implemented as an independent color in the palette. There is no translucency in GIF.

To record an image with transparent areas in PNG format select menu File/Export As(note, it is Export As, not export; in some versions of Gimp this line is not translated into Russian) and in the dialog that appears, enter the file name, for example linux.png. Next, click the button " Export", in the dialog for setting PNG parameters, do not touch anything and click " Export".

And this is what the settings look like when exporting to GIF. We also don’t touch anything and press “ Export".

Here's another interesting point. When you open a PNG or GIF image in Gimp, there is no need to check whether there is an alpha channel or not, as described in Step 1. The alpha channel in a PNG or GIF always exists and you can immediately start working with a transparent background without manual addition alpha channel.

Step 5: Putting it all together

Now let's check the result of our work. We'll take an image with a transparent background and overlay it on top of a regular image. Let's place the pigguin in the shade of a palm tree:
In the picture with a penguin: Edit/Copy Visible (Shift+Ctrl+C) copy the penguin to the clipboard.
In the picture with palm trees: Edit/Paste (Ctrl+V) insert an image with a penguin into a photo with palm trees.

As you can see, transparency works. Where there used to be a white rectangle, the sea, palm tree and sand are now visible. The collage is ready. The image with the penguin fits seamlessly into the tropical landscape. Now let’s combine all visible layers (and we only have two of them) using the menu command Layer/Attach Layer (Ctrl+H). And write the finished collage to a file File/Export As.
Interestingly, after flattening the layers, the transparent background disappeared. In the final image, where the penguin is under the palm tree, there is no longer a transparent layer. If you want the transparent background on the layer with the penguin to remain for further work on the collage, then write the finished image to an XCF file (a native format for GIMP), just do not bring all the layers together, let them remain separate.

Conclusion

In this article we looked at how to make a transparent background in gimp 2.8. How to overlay an image with a transparent background on top of an existing one. We quickly went through the alpha channel. Found out which graphic formats support transparency. On simple example work with a transparent background was demonstrated.

Removal background a portrait or photograph of an object is removed if it clutters the photograph or if it is necessary to transfer the object to a different background. This operation can be carried out using a raster graphics editor, say, GIMP.

Instructions

1. Do it religiously backup copy the original image (or save it under a different name and only then proceed with modification).

2. For removing background The first method is to select the Scissors tool. Use it to outline the silhouette of the object around which you want to remove the background. Having closed the silhouette, adjust the locations of its points, and if necessary, add new, intermediate ones, the locations of which should also be adjusted. Later, click the middle of the object and the silhouette will become solid and the dots will disappear.

3. Copy the selected object by pressing Ctrl+C. Make a new image of such a size that this object fit into it. In this case, select the desired color background. Paste the contents of the clipboard there by pressing Ctrl+V. Select the Rectangular Marquee Tool and click on any point outside the silhouette. Later, you will save the result under a name that does not yet exist. In the same way, you can paste the contents of the clipboard into an existing picture with a background. After this, do not forget to move the object using the arrow keys to the desired location before deselecting it.

4. You can do without creating a new image. To do this, select “Invert Selection” from the “Edit” menu. The object will no longer be selected, but the background will become so. To remove it, press Ctrl+K in the old version of GIMP, and Ctrl+X in the new one. Later, select the color you want background and perform the operation “Image” - “Flatten image”.

5. For removing background The second method is to use the Eraser tool instead of the Scissors tool. Select your desired color background, and then set the diameter of the eraser so that it is easy for them to erase the background around the object. Having cleared the space around it, the remaining areas background delete using the Rectangular Marquee tool and the keyboard shortcut Ctrk+K (or Ctrl+X). After that, flatten the image as above.

6. To now transfer the object to a different background, select the “Magic Stick” tool and click on any point background around the object. After this, perform the operation “Selection” - “Invert Selection”. Press Ctrl+C. Having opened a file with a different background, paste an object into it by pressing Ctrl+V, turn on the Rectangular Marquee tool, adjust the position of the object using the arrow keys, and then click on any point background. Save the result under a different name.

It’s not always the case that when you photograph something, you end up capturing exactly the frame that you wanted. Often, when looking at a photo on a computer, you begin to realize that only a certain fragment is required from each photo. Also, a fragment of a photograph is sometimes necessary if you want to make an avatar out of it public network either a forum, or some kind of collage. In this article you will learn how to cut out a fragment from a traditional photograph using different programs.

Instructions

1. The most primitive option is to use Adobe program Photoshop. Open the program and load the photo you want to crop. On the toolbar, find the Crop tool, the icon of which looks like a black frame. Use the left mouse button to select a rectangular fragment in the photo, frame it by eye or specify the required dimensions in top panel, and press Enter. Save the new image under any name.

2. You can also obtain a fragment of a picture by cutting out a photograph from a video. To do this, open the video in the storyboard strip and select the desired frame on the viewing screen. Below the screen, click the camera icon (Capture) - the selected frame will be saved in jpeg format and it will be mechanically given a name with the time and date of the present day.

3. To cut a photo in Corel Photo Paint, upload the photo, and then select the “Image” section in the menu, and then “Cutout Lab”. In the window that appears, use the mouse to select the desired fragment of the selected photo - use the left button to draw a line for the border of the fragment, and erase the lines with the right button. Draw the boundaries around the required fragment, fill the resulting area and click OK. Save the cut out image. After that, open, if necessary, another image into which you want to paste a fragment, the one you just cut out. Scale them to identical sizes and proportions, insert a fragment into the required place in the image, export the resulting file and save it as a jpeg.







2024 gtavrl.ru.