Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




[Top] [Prev] [Next] [Bottom]



File and save


Here we will discuss how to save, open and create files, set preferences and what file format Gimp supports. We will also look into how you print from Gimp.

The file menu

In Gimp you can get to the file menu in two different ways. Either you press "file" in the Toolbox or you press your right mouse button in your image which will bring up the"root menu" where you will find a file entrance. The menus are a bit different here than in the Toolbox menu.

  • New
  • Open
  • About
  • Preference
  • Dialogs with submenus
  • Quit

And in the root file menu you will find

  • New
  • Open
  • Save
  • Save as
  • Preference
  • Close
  • Quit
  • Mail
  • Print

We will go through all that, except for dialogs, in this chapter.

A new image

Let's start by creating our first image. Choose file in the Toolbox and go to New. This will bring up the following dialog.

Here you can decide what size your image will have in pixels, whether your image should be grayscale or RGB, and you can decide if it will have a solid background or if it will be transparant. As you see, there are two kinds of "Background Fill" if you want a solid background in your image: "Background" and "White". White will obviously get you a white background, "Background" will get you a background defined by you in the Toolbox color icon (more about that in chapter X). Transparant results in a checked background that symbolizes transparancy. This is a nice feature if you are creating transparant GIF's. Lets stick to the default values and press OK. Now you have a new image that you can start working with. Let us close the image by choosing Close in the root file menu. This will close your image as opposite to Quit which will both close your image and quit GIMP.

You may wonder why you can't get a index image at once so you can create your nice GIF for the web. The reason is that it's quite hard to guess what colors you want to use in your image. Also, it's a very bad idea to start out with an indexed image. Hey, can't I create GIF's then? Of course you can. You only have to convert the image to indexed color (see chapter X). Always work with RGB, and don't convert it until you're finished with it. The same goes for every other indexed file format ex xpm.

Open a image.

Now we will open a image by using File/Open. This will pop up an open dialog, where you can browse to select the image you want.In the "Determine file type" menu you can choose what kind of file you want to open, or let GIMP do it automatically. It's wise to let GIMP figure out what kind of file it is. It's only when GIMP has a hard time determining what kind of image you are loading, that it's advisable to use the non-automatic options. Let's get you familiar with the interface and open some images in the usual formats GIF, JPEG and TIFF. Later in this chapter we'll discuss what kind of formats GIMP can read and write to.

A tip is that GIMP expands your file name so that you just have to type the beginning of the name and then press tab to get the rest, just as you would in bash or tsch.

Options when opening a Postscript or Pdf file

The open dialog for Postscript files or pdf files

My advice is: don't change any values here - the default values are quite okay for displaying the paper formats you would normally use for ps formats. If you lower the resolution you'll have to change the width and height of the imaginary paper. It is the other way around if you raise the resolution. If you don't increase the width and height when raising the resolution, you will only get a part of your ps file displayed. If the width and height exceeds the size of your ps file, the display will automatically be adjusted.

If you unchecked the "try BoundingBox" the pages would get stacked over each other. If not, they will be displayed side by side. "Pages" refers to what page, or what page interval you want to display; for instance 1-99 for page 1 to 99, or 75 for page 75 (if your ps file has less pages, don't worry, it will be adjusted automatically).

Checking B/W will get you a Black/White postscript from a color one, grayscale will get you a grayscale one, color will get you a colored one and automatic will get you whatever mode the ps file was created in. You can of course never get a colored image from a B/W postscript, even if you choose colored.

To Save an image

GIMP also lets you save the image you have created. Isn't it wonderful - it's not like when you get Photoshop for free in demo mode "save and print is disabled, this is a demo copy". The Save dialog is only reachable from the image root menu, this is because it is the active image you want to save, or save as. The "save" dialog is the same as the"open" dialog except that the"Determine file type" menu is a bit different. The default for Determine Filetype is "By extension", this means that if you name your image"hello.gif" it will be saved it in gif format. You can of course choose to save your"hello.gif" in tiff format, by selecting tiff in the menu, but this will be highly unrecommended. If you want to save a file without an extension, then you have to choose the file type. Just remember to flatten your image before you save it. The only two exeptions to this rule is if you save it in xcf format, which is GIMP's native file format, or if you save a gif file and want to do an animation.

GIMP supports many different file formats, how many depends on what plug-ins you have loaded. Yes, as with many things in Gimp, it relies on plug-ins. Examples of plug-ins are the mail and print plug-ins, and of course all the filters. We will discuss plug-ins later in this manual, for now we will concentrate on the plug-ins we need for saving and that comes by default in the general GIMP distribution.

File formats supported by GIMP

The list below will describe what file formats you can read respectively write to.

TABLE 1. File formats


Format

Write

Read

Format

Write

Read

Bmp

X

X

Png

X

X

Cel

X

X

Pnm

X

X

Fits

X

X

Psd


X

FaxG3


X

Postscript

X

X

Gbr

X

X

SunRas

X

X

Gif

X

X

Snp


X

Gicon

X

X

Tga

X

X

Hrz

X

X

Tiff

X

X

Header

X


Url


X

Jpeg

X

X

Xcf

X

X

Pat

X

X

Xwd

X

X

Pcx

X

X

Xpm

X

X

Pix

X

X

Gzip

X

X
.

XCF is the native GIMP format that will save your layers and other GIMP specific information. If you save your image in a different file format, your GIMP specific info will be lost, and you won't be able to open and edit your layers or other GIMP specific things (gif supports layers in the way that each layer becomes a image in a gif-animation). Be aware - only the active layer gets saved, if you save in other formats than XCF. If you want to save a layered image in tiff format - don't forget to flatten it before you save it. A brief description of the different file formats can be found in the bullet list. For more information about file formats, see the appendix X about graphic books and links.

  • : This list is far from complete; TODO is a better description.
  • BMP: This is an bitmap uncompressed format used within Microsoft Windows for displaying graphics. Color depth is typically 1, 4 or 8 bits, although the format will support more.
  • Cel: This is the file format used by KISS programs.
  • Fits: Flexible Image Transport System is mainly used in astronomy. It's for example used by NASA in their space program.
  • Fax: This is the format used by fax's. It's great if you have a electronic fax in your Unix workstation.
  • Gbr: This is the format used by GIMP's brushes. You will learn how to make brushes in chapter X.
  • Gif: Graphics Interchange Format trade marked by CompuServe and the LZW compression is patented by Unisys. Gif image is in 8-bit indexed color and can be transparent. It can also be loaded in interlaced (gradually) form by some programs. Gif also support animations and comments.
  • Gicon: This is the format used by GIMP in it's icon. The icons in the Toolbox have this format. It's supports only grayscaled images.
  • Hrz: This format is always 256*240 pixels and it is or was used in amateur slow-scan TV broadcasts. The format does not support compression it's just raw RGB data.
  • Header: This format is a C programming language header file. This is mainly for programmers who want to include their image in a C program.
  • Jpeg: This format supports compression and works in all color depths. The image compression is adjustable, but be aware, too high compression may damage your image severly, since jpeg compression is destructive. JPEG stand for Joint Photographic Experts Group.
  • Pat: This format used by Gimps patterns.
  • Pcx: Zsoft file format mainly used by the Windows Paintbrush program and the PC paint program.
  • Pix: This is a format used by the Alias/Wavefront program on SGI workstations. It supports only 24bit color and 8bit grayscaled.
  • Png: This is the format that is supposed to take over from gif and solve the trademark/patent issue. Indexed-color, grayscaled, and truecolor images are supported, plus an optional alpha channel. Png use compression but unlike jpeg it does not lose information about the image. PNG stands for Portable Network Graphics
  • Pnm: The portable anymap file format, pnm supports indexed-color, grayscaled, and truecolor images. It's mainly used to out put an pnm image that later can be converted with the programs that comes with the netpbm or pbmplus distributions.
  • Psd: This is the format used by Phothoshop from Adobe.
  • Postscript: This is a page describing language and it's mainly used by printers and other output devices. It's also an excellent way to distribute documents. Postscript is created by Adobe. This plug-in can also read PDF files (acrobat files). Read the installation chapter how to make this work.
  • Sunras: The Sun rasterfile format is used mostly by different Sun applications. The format supports Grayscaled, Indexed-color and TrueColor.
  • Snp: Format used by MicroEyes in their animations. You can load in this format and then save as gif to get a gif animation.
  • Tga: The tga file format is a file format that supports compression. The tga format supports 8, 16, 24, 32 bits per pixel in a image.
  • Tiff: The Tagged-Image File Format is designed to be a standard. There are many variations of tiff, considering that tiff supports six different encoding routines, and three different image modes: black & white, grayscaled and colored. Tiff with no compression format supports 1, 4, 8, 24 bits per pixel. Tiff compressed in the LZW format supports 4, 8, 24 bits per pixel.
  • Url: Uniform Resource Locator with this format you can download a picture from ftp or the web directly in to GIMP. The format in the open dialog is ftp://<address>/<file> or http://<address>/<file> for more info se installation chapter and appendix X.
  • Xcf: This is the native Gimp format.
  • Xwd: This is the format used by the screendump utility shipped with X. Xwd stands for X Window Dump.
  • Xpm: This is the file format used by color icons in X. Xpm in GIMP supports 8bit, 16bit, and 24bit images.Xpm stands for X PixMap
  • Gzip: Lets you open and save gziped images, the name of the file must be <name>.<well known suffix ex tiff>.gz.

Different options when saving files in GIMP

When you save your newly created image, for instance test.jpeg, it will bring up a dialog asking you what kind of compression and stuff you want. We will now take look at the different dialogs, and discuss what impact these parameters have on the image.

The Gbr save dialog. Spacing refers to the default spacing your brush will have

when you see it in the Brush dialog, you will learn more about this in chapter X. Description file means the name your brush will have in the brush dialog, for instance "Olof's test brush"

The Gicon save dialog.

Here you only need to type one value, and thats the name of your icon. Note, this is not the file name, it's the name of the icon in that way GIMP sees it?????

The Gif save dialog.

This dialog has many options. If you have flattened your image you can save it as an interlaced gif image, which means that it will be downloaded gradually by for example Netscape. You have probably seen this on the web, when the image is unrecognizable at first and then gradually gets better.

If you have layers in your image you can make a gif animation. If you just want to see the animation once, uncheck the loop button, otherwise it will loop forever. The delay input is the delay between frames in your animation. The checkboxes in the "Default disposal where unspecified" does the following: "Don't care" and "Make frame form...." is the same and it will begin to show you the first layer in your gif image and then add the second layer on top of the first. This mode is nice when you for instance creates a logo that is going to be "written" in a sequence one letter at a time. The other mode "One frame per layer" will use the first layer as the first frame, then use the next layer as second frame, just like in a movie. This mode is nice when you create a spinning thing, like a terrestrial globe.

If your gif image is transparant it will keep being transparant when you save it, transparancy works in both layered images and in flat images.

The Jpeg save dialog. This dialog

lets you set the quality and smoothing of the image, there is also an option if you want to optimize the image.

Since jpeg uses lossy compression, it's focused on compression where the human brain has the hardest time to tell the difference, namely the HUE part of the image (read more about in chapter X). This means that if you have a image with a small number of colors, you can set the quality lower. As a starting point, a quality of 0.75 is fine on a full color image, and it's often as low as you can go without losing to much info in the image. If you see that it's too lossy, increase the quality. But never go above 0.95 - the file will only get bigger without any improvement in quality. If you aren't so concerned about the image quality, then you can go down to 0.50. If you want images for indexing or something similar, then you can go down to 0.10. or 0.20 (personally I think xv is better suited to index images, see appendix X).

Sometimes sharp colorful edges gan cet a bit jaggy due to the nature of jpeg. Then you can increase the smoothing value to more than 0.00. This will blur the edges so they will get less jaggy. But be aware, the image can get very blurry and that's not good.

The optimize check button is for ???.

As a final advise don't save a tiff image of your precious mother in law as a low quality jpeg, and then delete the tiff image, because the your mother in law will be gone for ever. To put it simple, don't save in jpeg if the image is very important.

The Pat save dialog

This dialog lets you name the pattern. This is that name you will see in the Pattern dialog. Name it so you understand what it stands for, for instance rock for something rocky.

The Png save dialog

. This dialog lets you set the compression rate and whether the image should be interlaced.

Interlace is just like in the Gif dialog, which means that it will load gradually.

Png compression is handled by the zlibrary. If you slide the compression to 0, no compression will take place. If you slide it to 9 the image will be compressed by it's maximum. The zlib compression is lossless.

The Pnm save dialog

There is not much to say about it. I have always been saving in Raw format, because it's smaller (8-times) and faster than the Ascii format.

The Ps (Postscript)save dialog

, when you save your image as postscript it's not like when you are saving a tiff, gif, jpeg and so on. When you save to ps you have to specify your image size. You can see it as specifying your own imaginary paper that the image is going to be printed on. Then you can understand that an image of 300x416 pixels won't look to good if its going to be stretched out to 287x200 mm which is the default. You have to downsize or upsize the paper size depending on your image size. To do so - change Width and Height. The offset is the margin that your imaginary paper will have. The check button "keep aspect ratio" means your picture won't get deformed if you've calculated the wrong width and height relation. Say that you are going to save the 300x416-pixel image and that you decide that it's going to be 4 pixels per mm. Then the image will be 75x104 mm plus 2x5 mm at top/bottom plus 2x5 mm side which will get you 85x114 mm with a margin of 5 mm. Let's set Width = 75, Height=104, x/y-offset=5 Unit=mm and rotation=0. Now you can save in ps format and get a good result. If you have a rotation of 90 then you have to switch Width and Height, and the image will be saved in landscape mode. If rotation is 180 you'll get an upside down portrait mode, and a rotation of 270 will get you an upside down landscape mode.

The sunras save dialog.

When you save a sunras file, you get a dialog asking you if you want RLE encoding/compression or standard format. This compression is non destructive so it's generally good, but the RLE format supports only 4 or 8 bits per pixel at least in windows applications. (Have to do some checking).

The tga save dialog

. When saving a tga image you get a dialog asking you if you want RLE or standard encoding. As with sunras compression is generally good. The dialog asks you about the image type, and if you want to save it in 24bit or 32bit with an Alpha channel. Since my version of TGA is a bit buggy can't I say any thing about it.

The tiff save dialog

. The dialog asks you about what kind of compression you want to have. Since tiff compression is lossless there's no danger in using it. Use LZW with 4, 8, 24 bits per pixel images and Pack Bits with 1 bit per pixel images, for example faxg3 images.

Or is it so that lwz patent by Unisys is for pc and pack bits is for mac?

The fill order is in how the bits in your image are filled. Type 2 is least significant bit (lsb) to most significant bit (msb). Type 1 is the other way around. If I read the specification right, type 1 is the default and should be used with computer graphics. Type 2 is used by fax machines. If you should import the image in to Frame Maker or some other page setting programs, set none compression and MSB to LSB. Then you are on the safe side.

The Xpm save dialog

This dialog is lets you set the alpha threshold, to save saving time. 16bit and 24bit Xpm are supported on (say's the source code) 16 bits displays. 8bit images are coded but not tested. (have to test this a bit more)

Let's mail our image to a friend

Gimp can mail your picture. This can be a nice feature if you work on different locations. Then you can mail home or to your job. It will also bring a digital Christmas card to your friends and family. Be aware - the mail admin in your friend's network may not be so happy when you mail big images, so use it with care. Now, let's check out how to do it. In the root file menu, bring up the "Mail image". This will popup the mail dialog. The To file is the e-mail address of your friend. Subject is the subject of your email. Comment is a comment over the encoded file, for example: "Here's a nice picture of my new pet."

File name is the name of the encoded file that you will send to your friend. The name should be in the following format <name>.<well know suffix>.

How to print in Gimp

Before even starting to print in GIMP, you have to remember that it only prints the active layer, so you have to flatten your image before printing. Let also state that we're not going to discuss UNIX printing systems, spool systems and so on, it's beyond the scope of this manual. If you want more information on setting up printers and printing systems in LINUX/UNIX go to appendix X for links and books. What kind of printer does GIMP support internally? Open an image and bring up Print in the root file menu, this will bring up the Print dialog. As you can se in the Printer menu, GIMP supports the following printers.

  • PostScript printers
  • HP DeskJet 500, 500C, 520, 540C, 600C, 660C, 68xC, 69xC, 850C, 855C, 855Cse, 855Cxi, 870Cse, 870Cxi, 1200C, and 1600C printers.
  • HP LaserJet II, III, IIIp, IIIsi, 4, 4L, 4P, 4V, 4Si, 5, 5FS, 5L, 5P, 5SE, 5Si, 6L, 6P printers
  • EPSON Stylus Color, Color Pro, Color Pro XL, Color 400, Color 500, Color 600, Color 800, Color 1500, Color 1520 and Color 3000 printers.

Gimp supports the most common printers internally, so you don't have to have Ghostscript installed. If you have Ghostscript installed and use it as a printer filter for your printers, then all printing will be in postscript. But I think you people with Ghostscript installed should make a raw device, and let Gimp print directly to it, at least for testing, so you can follow the examples in this book.

The Output type B&W/Color is what kind of printer you have, if you have a color printer, use color mode, otherwise use B&W which will produce a grayscale image.

The media size is the paper you have put in your printer. GIMP supports Letter, Legal, Tabloid, A4 and A3 papers, although your printer may only support one of them.

The Orientation menu, will let you set Landscape or Portait mode, or letting Gimp decide on your scaling factor in Auto mode.

When you open the print dialog, scaling is set to 100 and the picture is stretched so it will cover all of the page (a margin of 6mm on the sides, and 13mm on top/bottom is left empty). Be aware of this, since a small image will be so enlarged that it will look very jaggy. There is a lot to discuss when printing images, but for now let's stick to that we have to do to get our image to look good. A picture which is 300x416 pixels will look good if the scaling is around 30 on a A4 paper. The procedure is as when we saved in ps format.

The Brightness is by default 100, and it's quite good for printing to lasers and B&W inkjets. Usually you have to increase this value if you print to a color inkjet. The author of the plug-in says 125 to 150, but for me that's too bright. I use 110 for our Deskjet 870Cxi. The bottom line is that you have to find out for yourself what gives the best results for your printer.

The command/file input line allows you to specify a printer command, the default printer command is |lp which will print to the default printer in a SysV system. Since most Linux distributions use Berkley printing system or LPRng you have to change it to |lpr which will print to your default printer. If you want to print to another printer use |lp -d <printer name> or |lpr -P<printer name> for more info see appendix X. If you have another printing system use |<command> the pipe is the sign that the following is a command. You print to a file also just use <were you want the file to be>/<filename> for example /tmp/hej.ps. A warning is in place if you print to a file that already exists. It will be overwritten without you knowing it. There is another print plug-in that is not shipped by default in Gimp see appendix X where to find it.

Gimp preferences

You can set the most basic preferences in the file/preferences or the file root menus. This will bring up the preference dialog

. In this dialog you can set how many levels of undo you want (notice that if you increase the levels of undo, the GIMP cache will get very big) it's usually enough with five levels of undo. The Transparency type determines what your checkers will look like, and you will have to test and find out what fits you. The same goes for Check size, we use the default and that's alright with us. There are more settings that you can do to GIMP in the $HOME/.gimp/gimprc file (ex /home/karin/.gimp/gimprc) see appendix X for a list of parameters in the gimprc file.



[Top] [Prev] [Next] [Bottom]

karin@frozenriver.ale.se
Copyright © 1997, Karin Kylander


With any suggestions or questions please feel free to contact us