在 Fedora 上使用 GIMP 轻松编辑图像
GIMP
![](/data/attachment/album/201912/01/214500n2f4c7wxfoa8bfgg.jpg)


GIMP（GNU Image Manipulation Program 的缩写）是自由开源的图像处理软件。它有很多的功能，从简单的图像编辑，到复杂的滤镜、脚本，甚至是动画，它是流行的商业同类软件的一款很好的替代品。


继续阅读来学习如何在 Fedora 上安装和使用 GIMP。这篇文章涉及基本的日常图像编辑工作。


### 安装 GIMP


GIMP 在官方 Fedora 存储库中可获得。为安装它，运行：



```
sudo dnf install gimp
```

### 单窗口模式


在你打开应用程序后，它显示带有工具箱和主编辑区的暗色主题窗口。注意，它有两种窗口模式，你可以通过选择“<ruby> 窗口 <rt>  Windows </rt></ruby> -> <ruby> 单窗口模式 <rt>  Single Window Mode </rt></ruby>”在其中切换。通过选中这个选项，用户界面的所有组件将显示在单个窗口中。否则，它们将是分离的。


### 加载图像


![](/data/attachment/album/201912/01/214501z4zzv59ve5nklewl.png)


为加载图像，转到“<ruby> 文件 <rt>  File </rt></ruby> -> <ruby> 打开 <rt>  Open </rt></ruby>”，然后选择你的文件并选择你的图像文件。


### 重新调整一个图像的大小


为重新调整图像大小，你可以基于一对参数重新调整大小，包括像素和百分比 —— 在编辑图像时，这两个参数很方便。


让我们假使我们需要缩小 Fedora 30 背景图像到它当前大小的 75%。为此，选择“<ruby> 图像 <rt>  Image </rt></ruby> -> <ruby> 比例 <rt>  Scale </rt></ruby>”，然后在比例对话框上，在单位下拉列表中选择“<ruby> 百分比 <rt>  percentage </rt></ruby>”。接下来，输入 “75” 作为宽度或高度，然后按 Tab 键。默认情况下，其它尺寸将自动地调整大小，以相应地与更改的尺寸保持纵横比。现在，保存其它选项不变，并按比例。


![](/data/attachment/album/201912/01/214501mpv1x33myauolyll.png)


该图像缩小到其原始尺寸的 75%。


### 旋转图像


旋转是一种变换操作，因此，你可以从主菜单下的“<ruby> 图像 <rt>  Image </rt></ruby> -> <ruby> 变换 <rt>  Transform </rt></ruby>”下找到它，其中有图像旋转 90° 或 180° 的选项。在上述选项下也有垂直或水平翻转图像的选项。


让我们假使我们需要旋转图像 90°。在应用一次 90° 顺时针旋转和水平翻转后，我们的图像将看起来像这样：


![](/data/attachment/album/201912/01/214502dnm95p9oqjcpjnnz.png)


### 添加文本


添加文本非常简单。只需要从工具箱中选择 “A” 图标，然后，在你的图像上，单击你想要添加文本的位置。如果工具箱不可见，从“<ruby> 窗口 <rt>  Windows </rt></ruby> -> <ruby> 新建工具箱 <rt>  New Toolbox </rt></ruby>”打开它。


当你编辑文本时，你可能注意到，文本对话框有字体自定义选项，包括字体系列、字体大小等等。


![](/data/attachment/album/201912/01/214503p9gwwgkk113653ow.png)


### 保存和导出


你可以从“<ruby> 文件 <rt>  File </rt></ruby> -> <ruby> 保存 <rt>  Save </rt></ruby>”或通过按 `Ctrl+S` 来将你的编辑保存为一个带有 `.xcf` 扩展名的 GIMP 工程。或者，你可以导出你的图像，例如，以 PNG 或 JPEG 格式。为导出图像，转到“<ruby> 文件 <rt>  File </rt></ruby> -> <ruby> 导出为 <rt>  Export As </rt></ruby>”或按 `Ctrl+Shift+E`，接下来，在你面前将产生一个你可以选择输出图像和名称的对话框。




---


via: <https://fedoramagazine.org/edit-images-on-fedora-easily-with-gimp/>


作者：[Mehdi Haghgoo](https://fedoramagazine.org/author/powergame/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[robsean](https://github.com/robsean) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
GIMP (short for GNU Image Manipulation Program) is free and open-source image manipulation software. With many capabilities ranging from simple image editing to complex filters, scripting and even animation, it is a good alternative to popular commercial options.

Read on to learn how to install and use GIMP on Fedora. This article covers basic daily image editing.

## Installing GIMP

GIMP is available in the official Fedora repository. To install it run:

sudo dnf install gimp

## Single window mode

Once you open the application, it shows you the dark theme window with toolbox and the main editing area. Note that it has two window modes that you can switch between by selecting *Windows* -> *Single Window Mode*. By checking this option all components of the UI are displayed in a single window. Otherwise, they will be separate.

## Loading an image

![Fedora 30 Background](https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-00-44-300x165.png)

To load an image, go to *File* -> *Open* and choose your file and choose your image file.

## Resizing an image

To resize the image, you have the option to resize based on a couple of parameters, including pixel and percentage — the two parameters which are often handy in editing images.

Let’s say we need to scale down the Fedora 30 background image to 75% of its current size. To do that, select *Image* -> *Scale* and then on the scale dialog, select percentage in the unit drop down. Next, enter *75* as width or height and press the **Tab** key. By default, the other dimension will automatically resize in correspondence with the changed dimension to preserve aspect ratio. For now, leave other options unchanged and press Scale.

![Scale Dialog In GIMP](https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-17-33-300x262.png)

The image scales to 0.75 percent of its original size.

## Rotating images

Rotating is a transform operation, so you find it under *Image* -> *Transform* from the main menu, where there are options to rotate the image by 90 or 180 degrees. There are also options for flipping the image vertically or horizontally under the mentioned option.

Let’s say we need to rotate the image 90 degrees. After applying a 90-degree clockwise rotation and horizontal flip, our image will look like this:

![](https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-41-28-300x243.png)


![](https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-41-28-300x243.png)

## Adding text

Adding text is very easy. Just select the A icon from the toolbox, and click on a point on your image where you want to add the text. If the toolbox is not visible, open it from Windows->New Toolbox.

As you edit the text, you might notice that the text dialog has font customization options including font family, font size, etc.

![Add Text To Images](https://fedoramagazine.org/wp-content/uploads/2019/10/Screenshot-from-2019-10-25-11-47-54-300x237.png)

## Saving and exporting

You can save your edit as as a GIMP project with the *xcf* extension from *File* -> *Save* or by pressing **Ctrl+S**. Or you can export your image in formats such as PNG or JPEG. To export, go to *File* -> *Export As* or hit **Ctrl+Shift+E** and you will be presented with a dialog where you can select the output image and name.

## tom

As a long term Gimp user i can recommend the multi window view, espacially on a two monitor setup where i can put combined toolbox on the secondary screen.

Also if one would like to go in deep with the Gimp there is https://www.gimpusers.com/ which serves news arround Gimp as well as a lot professional tutorials.

## Tim

Thank you! I had no idea that website existed until now. I will definitely be using it.

## nicu

Also a long time professional Gimp user, I use multi window view on the desktop, but when have to do some work on a tiny 10″ portable, go with the single view.

Multi window allows you to make better use of the screen space while the single window is less scarry for newcomers.

## hammerhead corvette

I had no clue about the gimpusers website. Thanks

## Tao

There’s also an upcoming fork with a new name: https://github.com/glimpse-editor/Glimpse

GIMP is great software, but a common problem is that FLOSS advocates have a hard time getting it to gain traction in their workplace — because of the name!

## Silvia

To be honest, so far I’ve been told many things, mostly in comparison to Photoshop, but not one person pointed to the name being an issue.

## Seoc McPherson

I’ve never had an issue suggesting GIMP at work. I don’t see how it’s useful to waste effort attempting to rebrand something that is already so well established.

## Redlove

Thanks 🌸

## Fedora User

Open Source GIMP, Krita, Inkscape, sK1, Scribus has Replaced Adobe, Corel, Microsoft & Apple for me as a designer with the Fedora Design Suite!

Keep up the good work 8)

## Rene Reichenbach

Dont forget about Darktable another gem to be used alongside.

## ewtger4

convert are faster

better show script in gimp

## hammerhead corvette

I’d like to see a simple way to include arrows and highlights on screenshots, kind of like sketch (MacOS) as I have not found a simple way of doing so on Linux.

## Jonatas Esteves

Flameshot is in every distro and does just that:

https://github.com/lupoDharkael/flameshot

## hammerhead corvette

OMG ! I love you for that ! Thank you !!!

## Craig Parker

Wow. I’ve been monkeying with GIMP to do this and never knew that there was a better app for editing screenshots all along. Thanks Jonatas!

## New Path

GIMP also offers a scripting language, Script-Fu (https://www.gimp.org/tutorials/Basic_Scheme/), that can be used to create new neat effects or automate pre-defined routines that needs to be applied to many images!

## Joe

I did a video tutorial about Gimp and a lot of other Linux stuff. Sorry the video is using LinuxMint, but I also love Fedora. https://opensourcetechtrn.blogspot.com/