Notes on learning Gim 4.x On ArchLinux for screen shots to work, just run like: dbus-launch gimp ... GOTCHA: Screen shot does not work unless you invoke Gimp like: dbus-launch gimp Patterns: http://www.well.com/user/xanthian/link_pages/GimpStuff/GimpResources.html EXIT Gimp with the Toolbar window menu / title bar. IMPORTANT: Remove any selections (Ctrl-Shift-A) before painting! Gimp is a raster (pixel-based) program. The Paths feature is vector-based though. Gimp determines file type by magic number, not by filename extension. Alpha transparency = 8 bit transparency. Vs. binary 1 bit transparency. ON = opaque To create a RGBA img (RGB with alpha channel), just create with setting: BG color transparent. If you export (save to a non-xcf) format, make sure to save as xcf too, because Gimp doesn't consider the image dirty after an export. HELP. As clearly stated on download pages, you have to download HELP separately. COLOR PICKING. The color picker "tool" can only pick from an opened image. However, the color Dialog (used for FG/BG color selections, for example) has its own color picker icon which will duplicate any color on your screen. To get standard docked windows: Pulldown File / Dialogs / Create New Dock Right-click on image gives pop-up version of main Image dropdown menu. Guides Click and drag from a ruler onto image. Click and drag on a rule to move or remove. Bottom left: QuickMask toggle, for selecing by painting. Image window At bottom are shown mouse pointer offset in image + and zoom + ruler/other units + Nav control. Zoom = viewing scale Nav control is for panning in images larger than your window size. Cool things Image Window: View / Shrink Wrap resize window to fit image. (grows as well as shrinks). Docking and Tabbing Dock containers may hold only persistent non-image windows. You dock by click&dragging the Drag Handle Area of dockable windows onto the blank, narrow, horizontal Docking Bars. You add a tab by doing the same thing onto any other area of the target window. I.e., to dock/undock/tab/untab, you click and drag with the Drag Handle Area instead of the title bar. Little, right-justified, arrow button is the tab settings button. Prefs File / Preferences / Toolbox: Select which indicators to show under the toolbar tool icons. Channel: I think it's just an 8-bit-per-pixel map for the full size of the Channel's layer. Image modes: RGB is normal. Indexed uses a color map and assigns one of 256 colors to each pixel. I guess 8 bit intensity + 8 bit color per pixel instead of 8 bit R + G + B. Grayscale has just one 8 bit intensity value per pixel. (Some digital cameras can save 16 bits/pixel). GIF and PNG files make Indexed files in GIMP. Define Indexed color map with image submenus Colors / Map. FILE FORMATS (plus see the "saving" sections). GIFs can't store print resolution. GIFs store only boolean 1-bit transparency. IE < v. 7 doesn't display PGN transparency properly. When export to GIF, alpha values are converted to 1 bit on-offs. PNGs support alpha transparency. JPEG best for color photos. PNG better for limited color images. PRINT SIZE CONTROL COMPLETELY SUCKS I don't know if it is to do with Gimp or the OS printing system or something else, but image print resolutions have no effect on printing! Compare settings at /Image/Print Size... dialog vs. Image Settings tab of /File/Print... dialog. /File/Print... Image Settings resolutions change wildly, apparently trying to be smart and adjust for best look. My printer is 600 DPI, so I would think that any even fraction of that should print well, like 600 or 150 or 15. The /Image/Print Size... dialog sizes are actually saved into .xcf and .jpg files (I doubt for .gif). Imagemagick printing really sucks. To print an image from Linux, you must use a program that can handle image printing, such as Gimp, xv, or a web browser. (As I said, not ImageMagick). THIS IS APPARENTLY ABOUT ALPHA TRANSPARENCY, NOT BINARY TRANSPARENCY. Transparency. If an image doesn't support transparency, use Image menu Layer / Transparency / Add Alpha Channel. Gimp automatically does a mode-switch as necessary for target image format when exporting. The Opaquity slider in the Layers Dialog sets the opaquity for the currently selected layer. Need to create an alpha layer for alpha tranaparency. Every layer other than the background (bottom) layer must have an alpha channel. Preview screen. Seems that the image window is called the Preview window. ? Seems they have fixed this with 2.4.3. They pull up an additional Export Preview window. When saving JPEGs, at lease, use the Preview button and view effects of the quality scroll bar in the main window (notice that the status bar shows that it is a previes). Quality > 95 "generally not useful". Smoothing reduces compression artefacts at the cost of blurring. When saving PNG. Save BG color used when too many transparency levels by some (probably no) browser. Gamma useless. ALways use compression level 9 unless takes too long to SAVE (not load). Cropping. The pen-knife tool is the crop tool. You click&drag to make the rectang to be retained. Flipping. The <--> tool is the flip tool. Lines. Shift-click with any paint tool to draw a line with the current brush from last drawn point to the current mouse cursor position. Moving. The 4-arrow tool is for moving, not selecting. Click & dragging external files. Click onto Gimp toolbox to run Gim w/ it. Click and drag into image window to add it as a layer. Clip-board. Paste from clipobard to new image with File / Acquire / Paste as New. WEB IMAGES Usually no reason for alpha channel for web image. Usually won't be there for photos though. Remove with Image Flatten Image (makes just 1 layer w/ no alpha layer). Save limited color image as PNG with max. compression. Can save size converting to "indexed" mode, but don't if you need smooth color transitions. For alpha transparency, create an alpha layer and remove the bg layer. PAINTING TOOLS work on the current selection only. ERASER paints transparency if there is a transparency channel to current layer; or bg color otherwise. DEL key / Edit / Clear fill selection with: opaquity 0 if transparency channel for layer; BG color otherwise Some selection tools have a feathering checkbox, which means gradual edges. These DO NOT WORK with indexed images. CONTIGUOUS Color selection tool is the Magic Wand. Ctrl-Alt-Click-and-drag on a NON-HANDLED Selection to move the contents and clear the previous area. You can keep moving it until you de-anchor it. Shift-Alt same with a copy. Top copy areas, it's extremely convenient to place them as a saparate layer so you can continue to resize or minipulate the copied items atomically. Select the area, ctrl-C, ctrl-V (the ctrl-C and ctrl-V do not have to be done on the same image). Then right click the new floating layer and say to make new layer. It will make a new layer out of the floating layer, and will be cropped just as you would want it. When resizing layers, try both Scale and Set Borders and pay attention to the link icon to preserve aspect ratio or not, as you wish. I think that Set Borders will only work on the part of the image intersected by the image canvas, not necessarily the entire layer. Lasso tool = Free Selection Can adjust an existing section by Shift-Lasso (add) or Ctrl-Lasso like so: Cross the original border and recross it. The new section will be added/ subtracted. Painting selections with Quick Mask. Select with white. De-select with black. (Gray for in between). Can also use select tools and fill. Layer Mask: Just a layer-specific alpha channel. WHITE=On (main image layer opaque); BLACK=Off (main image layer transparent) Move cursor off of the image window and the Status message will reflect whether you are editing the main image or the mask. Don't need Menu to say which to Edit, just click on the icon in the Layers Dialog. Use "Show Layer Mask" to see/paint the layers' B&W. "Apply Layer Mask" is just like "Delete Layer Mask" except is merges the mask effects into the main image before the removal. Black / full trans. Black = Transparent; White = base image visible/opaq. Makes a good transparency mask (effect is lost with .jpg exports though) PATHS. A Gimp path is actually a collection of disconnected paths called "components". Design mode Click to create NEXT anchor on component. Ctrl-Click on first anchor to close comp (and stops anchor-creation) Click on any anchor or segment to move it (and stops anchor-creation) Shift-click makes starting anchor for a new component. Cursor sub-icon indicates what click will do: square to start new component + to create next anchor cross to move Ctrl-Alt-Click&drag to move entire component like a selection. Shift-click nodes to move > 1-at-a-time. Use the eyes in the Path Dialog to make paths visible. BRUSHES Seems that the paint brush doesn't draw 100% opaque when set to 100% opaque. I guess if you want that, you need to use the pencil. The 3x3 size rating for the smallest brush seems to apply only to paint brush, since pencil is 1 pix. When you "copy" a brush is made with that. All of the painting tools (other than ink tool) use the same set of brushes. Trivial to create brushes. Non B/W images draw with indicated color instead of fg/bg color. GRADIENTS The gradients to choose from are often algorithms to get from the left color to the right color. The FG/BGs use the FG and BG colors as the left and right colors. Some have opaquity variance too. Outlined shapes Edit/Stroke selection. Channel Dialog. This dialog shows the NET channel for the VISIBLE layers in image (i.e. sum for all visible layers). White - activeness: either the RGB color or opaquity of alpha. For opaquity, this is the OR sum of opaquity of all layers. LAYERS Only bottom layer may be without a transparency channel. Middle column is for linking layers for joint operations. Each text item goes into its own layer. Lock alpha prevents you from painting on transparent pixels. To save memory, make a layer only large enough to contain what it needs to contain. Copy & Paste-to-Layer and Text layers do this. Can do self after layer is ready by just Layer / Autocrop Layer Yellow&Black ants mark border of current Layer. The icon representation of layer's cross-hatch transparency indication is inconsistent and can't be relied upon. Usually, but not always, cross-hatches indicate transparency. Photo adjustments Colors: Tools / Color Tools / Levels looks good. You select pixel which "should be" pure white, and same for black. Exposure (brightness & contract) brightness/Contrast tool Region-specific exposure: Draw with grays on a new gray-scale image with multiply or divide mode. Fixing hue (too much or little of specific colors): Color-pick a pixel which should not have any color and verify the RGBs are equal. Hue/Saturation tool lets you adjust HSV directly. De-blurring: Use Filters/Enhance/Unsharp Mask (amplifies noise and adds artifacts at sharp edges). De-graining: Selective Blur filter or Despeckle filter. Costs you sharpness. Softening. I.e., de-sharpening. Filters/Blur/Blur. Removing lens grunge: Despeckle filter on a small area containing the grunge. Success is proportional to contrast of the grunge. Clone. Allows you to paint over one part of image using pixel data from anywhere else. Healing tool is similar. Remove red eye filter. Need to select the red color first. HSV Hue: Color Saturation: Difference from the corresponding gray Value: Lightness (whiteness/blackness) COLOR MANAGEMENT. So that colors look right regardless of device. Digital photos and scans conatin their "color profile mapping". You need to make a color mapping for your monitor. Manual gives no clue how to check this. System wide? There are settings in File / Preferences / Color Management, but I have no idea where to get the profiles that needs. PREFERENCES Can edit $HOME/.gimp*/gimprc manually. Man page "gimprc". POSITIONING (in addition to mouse dragging) Arrow keys move things one-pixel-at-a-time. SHIFT accellerates to 25 pixels/click. Moving layers. Use move toole and SHIFT click&drag. Grids are regularly spaced. Present but invisible by default. can be separately made visible, and snapping. Guides are made from rulers wherever you place them. Visible but not present by default. If working with big stuff and Gimp starts swapping tiles to disk too much, turn up til disk usage to half of physical RAM (as a first stab). Plugins are binary plugins. Simple ones can be built with a provided gcc wrapper from a single *.c file, and the compiled binary placed into the right plugin directory (File / Preferences / Folders/Plug-Ins). Lookslike "Procedures" may be plugins, or may be scripts of any type. DB Browser: /Xtns/Procedure Browser is great and lists details about all the functions, regardless of which menus they live in. Can also bring up with Browser button in the Script-fu Console. Also documents the API of Gimp built-ins. SCRIPT-FU *.scm files. The only OTS-supported script language is script-fu. A scheme variant. Menu location determination Seems menu location is independent of screen type, and just depends on the "script-fu-menu-register" call(s) in the script, where the first identifies the window menu, like or . script-fu-menu-register sets the parent menu, not the final item label, which is specified by 2nd argument of script-fu-register. Menu location may be a new top-level menu. Any needed intermediate menus will be created automatically. Standalone [/Xtns / Script-Fu / ] Obsolete? Mine are directly at Xtns / (Script-Fu language not differentiated). (The useful "Util" type scripts described in the manual are missing) Image-dependent [Script-Fu / ] Obsolete? LOOKS LIKE THEY INSTALL TO ANYWHERE YOU SPECIFY IN THE Image window menu system. Installing Save to one of the script directories File / Preferences / Folders/Scripts. Xtns / Script-Fu / Refresh Scripts To invoke scripts (incl. your own) which show a runmode param, use one of values RUN_NON_INTERACTIVE, RUN_INTERACTIVE, something else. SCHEME Every statement is surrounded by (parens). ; comment May use - in names, since - operator must be delimited with white space or parens. Function name/operator is always first, like: (functionname params...) (+ 2 3) "String literals like this" Newlines are just white space, as you would expect, but CONSOLE requires single-line commands!!! You do not need spaces on either side of a paren, but YOU DO AROUND params and values! It says that parens always delimit a command, so you must do like (+ 3 (+ 5 2) 7) CONSOLE: Xtns / Script-Fu / Console VARIABLES. There are apparently other methods. One way is let* function. (let* (VAR DECLARATIONS) COMMANDS) like: (let* ((a 2) (b 3)) (set! a (* a b)) (set! b (* a 2))) (Trying with single dim array will crash Console). Var declaration with initializing is just (varname). set! is value assignment Define function: (define (triple x) (* 3 x)) '(x y 1 2) outer-most means don't de-reference the inner lists. (cons 1 '(existing list)) = unshift (list x y 1 2) = creates a list and de-references the element values. (car '(3 4 5)) = shift (cdr '(3 4 5)) = remainder-after-shift: (4 5) GENERALLY c*r where * is any number of a=shift; d=remainer-after-shift's. GIMP Scheme Convention is to name Script-fu functions for Gimp like "script-fu-x-y". Prefix naming convention makes them sort nicely in DB Browser. (script-fu-register "FNAME" "MENU_LABEL" "DESCR" "AUTH" "COPYWR" "DATE" "TARG_IMG_TYPE" Params....) (Note that FNAME must match the defined function name). Then, (script-fu-menu-register "FAME" "/Parent/Menu")) Params are specified by concatendated triples of: TYPE "prompt" dflt_value Param types. See section 3.4.7 of chapt. 12 of the Gimp Manual. Color Constants with RGB list like '(0 102 255) Bool constants like TRUE Gim pfunctions all return a list, even if there is only one element (so use (car (gimp-*...)) to get the scalar return value. When creating Image type script-fu scripts, you must take 2 initial args of SF-IMAGE and SF_DRAWABLE. MUST RESTART CONSOLE for it to know about refreshed scripts. To test your functions in console, ignore the extra params shown in the DB browser and use the types you defined. You won't get the Gimp wrapper that you registered, you'll just be running your function directly (which is not what the DB Browser reflects). EXAMPLE: (script-fu-sphere 100 90 TRUE '(255 0 0) '(0 255 0)) (Just skip the run-mode param listed for script-fu scripts in the DB Explorer. N.b.! This just does not work for most script-fu* functions. Get errors like: "Error: /: argument 1 must be: number", even when argument 1 is a number. TRYING TO FEATHER AN ENTIRE LAYER http://www.ains.net.au/~mathman/gimptut/vignette_tut.htm looks useful. SHORTCUTS Ctrl-A (at least when in Layers Dialog) selects the entire layer. Ctrl-. BG-fill Ctrl-Shift-A Clear all selections (not clear as in DEL). BUG IN 2.4.2: Sometimes removes your scripts from $HOME/.gimp-2.4/scripts. Bump Maps. Raises a region of the current layer. /Filters/Maps/Bump Map. Select the mapping layer, which is best if B&W. Manual Drop Shadows 3D TEXT Make text black on white and do a gaussian blur w/ 5. TEMPLATES Templates can only be used to save the stuff in the /File/New... window. To share any other settings, just share the .xcf file. Templates are stored in $HOME/.gimp*/templaterc. There is no straight-forward way to share custom templates. The fill type (at least Transparency fill type) is not stored correctly by the normal Template save method. Must use /File/Dialogs/Templates dialog and Edit it with the correct Fill, then save from there. PALETTES /File/Dialogs/Palettes are sharable. COLOR MAPS /Dialogs/Colormap is image-specific (for Indexed files only). To import external images to a LAYER, don't use /File, use /File/Open as Layers... DRAWING POLYGONS, or SELECTING BY POLYGONS Use path tool. When ready to close, change to Edit mode and click first vertex again. Then Path-to-Selection. To make a new layer of copied stuff, Ctrl-V it, click on the layer and right-click Make new layer. (Don't need to Anchor- or Merge-down). Layer visibility does apply to rendering as well as to viewing inside Gimp. Layer opacity is Gif output. Works as you would want, as long as the export image has something beneath the partially opaque layer. Otherwise, if opacity > 50, layer output will be 100% opaque; and if opacity <= 50, layer output will be 0% opaque. IMPORTANT PREFS: Edit / Preferences. Window Management. Save Window Positions Now Edit / Preferences. Toolbox. Check all boxes. SELECTION None is very similar to ALL selected. What is different is Something (but not everything) selected. Using stylus to simulate hand-writing: Use pen tool with size 5.00 and foreground color 404040. PDFs Load pages as layers. Do work in .xcf format. for PDF FORMS, fill in the forms using Ocular For some reason Gimp can't read the form field values directly as written by Ocular. WORKAROUND to make Ocular fields visible to Gimp: Load in Browser and print-to-PDF. Load the PDF into Gimp with default pages-as-layers, but enable option Load-in-reverse-order. (to get same layer sequence) After manipulate (for example to merge down a signature layer), export to PDF with both options set: layers-as-pages (...), reverse-the-pages-order