Release notes/0.46

From Inkscape Wiki
Revision as of 07:45, 11 August 2009 by AmyChoiXoXo (talk | contribs)
Jump to navigation Jump to search

fractions of the available range.

  • Dragging with Alt moves the selected stops depending on how close each one is to the stop being dragged, using a smooth bell-like curve similar to the node sculpting feature in Node tool. This makes it easy to approximate different gradient profiles; for example, if you have a two-stop gradient that you want to shape according to a curve profile, select both ends of the gradient, press Ins a few times to add a number of intermediate nodes, then Alt+drag a node in the middle to smoothly profile the gradient.
  • Stops can also be moved by arrow keys with all the regular modifiers (Shift for 10x movement, Alt for pixel-size movement at the current zoom, Shift+Alt for 10 pixels movement at the current zoom).
  • Stops can be deleted by Ctrl+Alt+Click on a stop or by the Del key for all the selected stop(s).
  • When you delete an end stop, the nearest intermediate stop becomes the new end stop of the gradient (without moving - i.e., the gradient span becomes shorter).
  • When you delete an end stop and there are no intermediate stops, the object will be painted with a solid fill taken from the color & opacity of the remaining stop.
  • Pressing Ctrl+L with some intermediate stops selected attempts to simplify the selected portion of the gradient, removing those stops that can be removed without too much change in the way the gradient looks. In particular, new stops created by double-clicking or pressing Ins initially do not change the appearance of the gradient, so if you press Ctrl+L, all redundant stops that weren't moved or repainted since creation will be deleted.

Style of gradient stops

  • When you have one of the gradient handles selected, its style (color and opacity) is reflected by the selected style indicator (left of the statusbar) and the Fill&Stroke dialog. Previously, opacity of a gradient handle was reflected as fill-opacity and stroke-opacity; now it is reflected as master opacity (the "O:" spinbutton in the selected style indicator, the "Master opacity" slider in Fill&Stroke). This makes it much easier to view and change opacity of gradient handles using only the selected style indicator in the statusbar.
  • When multiple gradient stops are selected, the selected style indicator (in the statusbar) displays and controls the averaged color and opacity of the selected stops.
  • When one or more gradient stops are selected, using the Copy command (Ctrl+C) copies to the clipboard the style (color and opacity) of the selected stop or the averaged style of several selected stops, not the entire object with gradient as before. This means you can now copy/paste style between stops: select the source stop(s), copy, select the destination stop(s), paste style (Ctrl+Shift+V). With several selected stops, this also allows you to easily average their colors and opacities by copying them and pasting the style back onto them. (After that, redundant gradient stops can be removed by simplification with Ctrl+L).
  • If the selected object(s) have gradient in fill or stroke, the selected style indicator in the bottom-left corner of the editing window now displays a live gradient preview prefixed by R or L to indicate Radial or Linear gradients (instead of displaying "L Gradient" or "R Gradient" text labels as before). Also, this and other similar widget now use italic font face to indicate None and bold to indicate Unset.

Automatic duplication of gradients

When copy/pasting or duplicating an object with gradient, it now automatically gets a copy of the original gradient, so modifying it does not affect the source object's gradient anymore (before, you had to press the Duplicate button on the Gradient controls bar for this). The Duplicate button is therefore removed.

However, to accommodate the needs of users who have relied on sharing the same gradient definition across objects, this behavior can be optionally suppressed. The Prevent sharing of gradient definitions checkbox on the Misc tab of Inkscape Preferences is by default checked; if you uncheck it, Inkscape does not automatically copy gradient definitions for new objects, which means that copy/pasting, duplicating, pasting style, and explicit assignment of a gradient to an object via the Gradient tool controls results in a shared gradient definition, so that changing the colors or mid-stop positions of the gradient on one object (but not changing the coordinates of the end handles) affects all other objects that share the same definition.

Calligraphy tool: Engraver's Toolbox

Several new features were added to the Calligraphic pen to make Inkscape capable of the ancient art of line engraving. Traditional engraving is a very labour-intensive process, and while for a long time it was the only practical way of reproducing lifelike images in black-and-white print, about a century ago it was almost completely displaced by automatic halftone screens. However, line engravings have their characteristic charm, and there's no reason not to try to resurrect this art form with the help of Inkscape.

A brief visual guide to the new functionality can be seen on these screenshots:

http://inkscape.org/screenshots/gallery/inkscape-0.46-engraving1.png

http://inkscape.org/screenshots/gallery/inkscape-0.46-engraving2.png


Tracking a guide path with Ctrl

One of the most common operations in line engraving is hatching (or sometimes cross-hatching when several hatching grids cross): filling a space with many parallel straight or variously curved lines (usually of varying width to represent a gradual shading). You could try to achieve a similar effect with e.g. path interpolation (blending), but it is rather cumbersome and limited; manual drawing of hatch lines, on the other hand, is tedious and nearly impossible to do uniformly. Now Inkscape provides "assisted hatching" by tracking a guide path, allowing you to hatch quickly and uniformly and at the same time giving you sufficient manual control over the process.

Here's how to do this. First, select the guide path that you will track. It may be another calligraphic stroke, any path or shape, or even a letter of a text object. Then switch to Calligraphic pen, select the desired parameters (line width, angle, fixation etc.) and, before starting to draw, press Ctrl. You will see a gray track circle centered at your mouse pointer and touching the closest point on the selected guide path. (If you have no guide path selected, a statusbar message will tell you to select it.)

Now move your mouse close to the guide path, so that the track circle radius is equal to the desired spacing of your hatch pattern, and start drawing along the guide path. At that moment, the radius of the circle gets locked; now the circle slides along the guide path - and the actual stroke is drawn by the center of the tracking circle, not by your mouse point. As a result, you are getting a smooth stroke going parallel to the guide path and always at the same distance from it.

When the stroke is ready, release your mouse button (or lift your tablet pen) but do not let go of the Ctrl key because as long as you have it pressed, the tool remembers the hatch spacing you set when you started drawing. Now, you have just created a new stroke and, as usual with Inkscape tools, it gets selected instead of what was selected before. In our case, this means that the newly drawn stroke itself becomes the new guide path. Next, you can draw a second stroke along the first one, then a third one along the second, etc. Eventually you can fill any desired space with uniform hatching.

Alternatively, if you uncheck "Select new path" in the Calligraphy tool preferences, newly created strokes will not be selected, so your original guide path will be kept selected. In this mode, Inkscape will increase the tracking distance after each created stroke so that you can create uniformly spaced hatching by tracking a single guide path.

The attachment to the guide path is not absolute. If you stray your mouse pointer far enough from the guide path, you will be able to tear it off (the track circle turns from green to red) and move freely. This is intentional; this feature allows you, for example, to continue drawing a stroke past the end of a guide stroke, thus making your hatching cover a wider area than the initial guide path. Special care is taken to make such tearing off as smooth as possible and to suppress violent jerks, but this is not always possible; the general advice is to not try to hatch too fast. If jerking and unintended tearoffs still bother you, try increasing the Mass parameter.

Also, special code is in place to prevent flipovers - accidental jumps to the other side of the guide path. Brief flipovers are suppressed, but if you intentionally go over to the other side and stay there, eventually Inkscape will obey and your tracking stroke will also flip over to follow you.

Tracking a guide also allows some slight feedback by gradually changing the tracking distance in response to your drawing behavior. Thus, if you're consistently trying to draw closer or farther from the guide than the current tracking distance, the distance will correspondingly decrease or increase, so you will get a hatching that is slightly spacing in or out. (The effect is very slight, however, so as not to become a nuisance.) Also, note that since tracking follows the edge of the stroke, strokes of varying width (such as those tracing background, see below) will result in gradual bending of the hatching pattern as you proceed.

Tracing background by stroke width

There is a new toggle button on the Calligraphy tool's controls bar, Trace background. When on, the width of your pen depends on the lightness of the background under the stroke in each point, so that white translates into the minimum stoke width (1) and black translates to the maximum (which is set by the Width parameter). This can work alone or in combination with pressure sensitivity, depending on whether the "Use pressure" button is also toggled.

This feature allows you to not only hatch over an imported bitmap image or any drawing, but to do so automatically reproducing the highlights and shades of the background with your strokes becoming lighter and heavier as needed.

Misc features

  • For consistency with other drawing tools, drawing with Shift in Calligraphy tool automatically unions the newly created stroke with whatever paths were selected (and selects the result). Thus, you can do a series of overlapping Shift+strokes to create one unioned path object instead of separate objects as before.
  • To facilitate changing the Width parameter, the Home/End keys in Calligraphy tool switch you to the minimum (1) and maximum (100) width, correspondingly. (This is in addition to the Left/Right arrow keys that change Width by 1; remember also that you can press Alt+X, type any width, and press Enter.)

Selector

  • A new selection mode is available: selecting by touch. In this mode, you draw a freehand path across the objects; when you release mouse button, all objects that are touched by this path get selected. This mode is very convenient in situations where you need to select objects so intermingled that selecting them by the rectangular rubberband is too difficult and so numerous that click-selecting them one by one is too tedious.
To activate selecting by touch, whenever you are drawing a rubberband rectangle, just press Alt to switch it to the touch mode. The rectangle will disappear and a red touch path will be shown instead. When dragging from an empty space, you can press Alt first and then start to drag to get the touch mode (note that your selection must be empty, otherwise Alt+dragging will move the selected objects instead). To start a touch selection from a point over an object, or to add to existing selection by touching, press Shift+Alt and then start to drag.
  • Previously, the only way to switch selection from scale mode to rotate mode or back was to click on it, which was rather inconvenient when the selected object is in a group or under other objects. Now you can switch modes with keyboard as well by pressing Shift+S in Selector tool.
  • Draging the scale handles with Alt now scales selection by an integer factor, i.e. up to 2, 3, 4, etc. times the original size or down to 1/2. 1/3, 1/4, etc. of the original size (in any of the two dimensions independently), as well as to -1/3, -1/2, -1, -2, -3, etc. This way you can, for example, mirror any object around one of the edges of its box. (This replaces the old and rarely used "slow" scaling mode with Alt.)
  • Horizontal/vertical flipping: So far, flipping a selection made it flip within its bounding box, so that the latter remained fixed. In the move/scale mode of the selector tool, this behaviour remains unchanged. However, in rotate/shear mode flipping now happens about an (imaginary) vertical/horizontal axis through the rotation center. This is very handy, since the latter can be freely dragged around and snaps to all kinds of objects if desired.

Node tool

  • If any of the nodes in the currently selected path is mouseovered, then horizontal/vertical flipping ('H' and 'V' keys), stepwise rotation ('[' and ']' keys) and scaling ('<' and '>' keys) now all use this specific node as center/axis. If there is no mouseovered node, the center of the bounding box is used instead (as is currently the case unconditionally). Nodes that are covered by one of their handles are also detected as mouseovered.
  • As a long-requested feature, two entry fields are added to the toolbar which allow precise editing of the coordinates of selected nodes.

Rectangle Tool

  • Ctrl+dragging now also allows the creation of rectangles with sides constrained to the golden ratio (approx. 1 : 1.618034), not only integer ratios.

Ellipse Tool

  • It is now easy to create ellipses/circles passing through particular points. Normally, the starting and ending point of the mouse drag mark the corners of the bounding box. Now the Alt modifier can be used to enlarge the ellipse so that its circumference passes through these two points.
  • Ctrl+Alt+drag is an exception from this rule. It creates a perfect circle whose diameter is defined by the starting and ending point of the drag.

Pen/Pencil Tools

These tools can now create single dots by Ctrl+click on the canvas. This creates a small circle filled with the current stroke color. The radius can be set in the Preferences of the respective tools (it is specified as a multiple of the current stroke width). Shift+Ctrl+click creates a dot twice the specified size, and Alt+Ctrl+click varies the size of the created dots randomly.


Dropper Tool

The shortcut 'D' is now used to toggle (not just switch to) the dropper tool - much like space is used to toggle the selector tool. That is, pressing 'D' a second time switches back to the tool used before.

SVG features

The tref element

Inkscape can now correctly open files with tref elements, and new tref elements can be created manually in the XML editor.

The actual character data contained in a text element can either be embedded directly, or it can be the character content of an element referenced by a tref.

While the textual content from the referenced element will be stripped of any markup before being used by the tref, the tref element can itself have the same attributes as a tspan. In fact, when rendered, it is as though the tref element is replaced by a tspan with the same attributes, and the referenced character data is embedded in that tspan.

The property xlink:href is used to refer to another element whose character data will be used. Any element can be referred to except an ancestor of the tref. When any of the text contained in the referred element changes, the tref will immediately be updated to display the new data.

Existing tref elements can be converted into tspan elements with Edit > Clone > Unlink Clone. If more than one tref is contained within a selection, all trefs will be converted into tspans. All attributes applied to the tref will be retained in the new tspan.

A tref element can be mixed with any other elements allowed to be contained by a text element.

The cloned character data rendered by the tref may not be edited, but any characters surrounding it can be changed. Styles cannot be applied to a subset of the cloned characters, but if all are selected, a style can be applied to the tref.

SVG filters

New filters supported

  • The feBlend filter primitive gives us image blending modes, like in many image manipulation programs. These modes are screen, multiply, darken and lighten. There's a caveat, though: when blending an object against an semi-transparent background, the background will be accumulated twice, resulting in thicker objects under the bounding box of blended object. This is a limitation of current version of SVG format, not a bug in Inkscape.
  • The feColorMatrix filter primitive applies a matrix transformation to colour of each rendered pixel. This allows for effects like turning object to grayscale, modifying colour saturation and changing colour hue.
  • The feComposite filter primitive composites two images using one of the Porter-Duff blending modes (described in paper Compositing Digital Images by T. Porter and T. Duff, published in SIGGRAPH '84 Conference Proceedings, Association for Computing Machinery, Volume 18, Number 3, July 1984) or the aritmetic mode described in SVG standard. Porter-Duff blending modes are essentially logical operations between the images. For example, xor mode shows the areas, where either one of the objects is, but not the areas where both of the objects are. Arithmetic mode lets you specify coefficients k1-k4 for blending equation (result colour) = k1 * (first input colour) * (second input colour) + k2 * (first input colour) + k3 * (second input colour) + k4.
  • The feConvolveMatrix lets you specify a Convolution to be applied on the image. Common effects created using convolution matrices are blur, sharpening, embossing and edge detection. There's a fairly good explanation and some example matrices at www.gamedev.net/reference/programming/features/imageproc/page2.asp. Note that while gaussian blur can be created using this filter primitive, the special gaussian blur primitive is faster and resolution-independent.
  • Filter primitives feDiffuseLighting and feSpecularLighting create lighting maps for the object in input image. SVG doesn't have concept of third dimension, so these filters use alpha channel of input image as a height map: the more opaque given point in input image is, the nearer spectator it is considered to be. There exists an example for using these in Inkscape distribution, in share/examples/lighting_effects.svg or in SVN
  • The feDisplacementMap filter primitive displaces the pixels in the first input using the second input as a displacement map, that shows from how far the pixel should come from. Classical examples are whirl and pinch effects, that can be found in most image manipulation programs and even in some screensavers, where this kind off effect is moving around screen, twisting desktop beneath it.
  • The feFlood filter primitive fills its region with a given color and opacity. It can be used as an auxiliary tool, usualy in combination with other filter primitives, in order to facilitate some common color handling operations.
  • The feImage filter primitive allows using external images as part of filtering chain. For example, one could use external image as a displacement map for feDisplacementMap or as a height map for lighting effects. Note that while SVG standard allows using other parts of the SVG file in this filter primitive, the current Inkscape implementation only allows external images.
  • The feMerge filter primitive composites several temporary images inside the filter primitive to a single image. It uses normal alpha compositing for this. This is equivalent to using several feBlend primitives in 'normal' mode or several feComposite primitives in 'over' -mode.
  • The feMorphology filter primitive provides erode and dilate effects, that are common in image manipulation programs. With erode, darker and more transparent areas spread to lighter and more opaque areas, whereas with dilate lighter and more opaque areas spread to darker and more transparent areas. For single-colour objects, this basically means, erode makes the object thinner and dilate makes it thicker.
  • The feOffset filter primitive offsets the image by an user-defined amount. For example, this is useful for drop shadows, where the shadow is in a slightly different position than the actual object.
  • The feTurbulence filter primitive renders Perlin noise. This kind of noise is useful in simulating several nature phenomena like clouds, fire and smoke and in generating complex textures like marble or granite.

See also wiki page Filter Effects for more info on filters in Inkscape in general.

Filters UI

  • New dialog for creating and modifying filter effects (Object>Filter Effects...)
  • The list at the left of the dialog displays all filters currently in the document.
    • New filters can be added with the Add button beneath the list
    • Right-clicking a filter for the pop-up menu allows duplicating or removing a filter.
    • Double-clicking a filter will apply it to all selected objects
    • A black dot is placed next to whatever filter is applied to the selected objects. If more than one filter is in use by selected objects, an unfilled dot is used instead.
  • The second list, at the left of the dialog, displays the filter primitives that are contained within the currently-selected filter.
    • New primitives can be added by selecting the primitive type from the combo box beneath the list, and then pressing the Add button.
    • Right-clicking a primitive for the pop-up menu allows duplicating or removing a primitive.
    • Primitives can be rearranged by clicking and dragging any filter in the list.
    • When a filter is selected, the Settings group at the bottom of the dialog will change to display the attributes available for that primitive. Changing a setting results in an immediate update to the document.
    • The "in" and "in2" attributes for filters that support them are not shown in the Settings group. These input connections are displayed graphically in the list, under the Connections column.
      • Inputs for a particular filter are displayed as triangles. Depending on the primitive type, there may be one or two inputs (or more for Merge primitives.) Connections can be created by clicking on a triangle and dragging.
      • There are six standard input types that can be used for any primitive input; Source Graphic, Source Alpha, Background Image, Background Alpha, Fill Paint, and Stroke Paint. These are displayed vertically on the far right of the list. Click and drag from an input triangle to one of the standard inputs to connect them.
      • Primitives can also be connected to other primitives by clicking an input triangle and dragging upwards to another primitive. A primitive can only be connected to one higher up the list.
      • Single-clicking on an input triangle will unset it, returning it to the default. If it is on a Merge primitive, the input will be deleted.
      • Merge inputs have an empty input at the end. Dragging a connection from this input will add a new input to the primitive.

Live Path Effects (LPE)

Live path effects (not to be confused with extension effects or SVG filters) are a new way to non-destructively modify path and shape objects. Path effects affect the path data of an object but not its style. The original path is preserved and can be edited directly on-canvas, and the path effect applied to it will be updated live.

In this version, we include several path effects that are analogous to the corresponding extension effects (such as Path along Path effect and Pattern along Path that replaces the extension of the same name). The most important advantage of path effects is that they are, indeed, live - you can still edit the original path and the effect will update in real time (unlike the extension effects which were one-time one-way transformations). In the future, we plan to reimplement most if not all of path-changing extensions as live path effects.

Live path effects were developed by Johan Engelen as part of the GSoC 2007.

Details about operation

The following schematic tries to explain how LPE work.

   original style  ------------>  output style
   original path   -->  LPE  -->  output path
                         ^
                         |
                     parameters

The original style and path are from the path that the effect is applied on. The output is what is visible on screen. What is very important to notice is that output style equals original style.

The parameters can be paths, numbers, points, text, in principle anything.


Applying effects

Path effects are applied through the Path Effects dialog (opened from the Path menu, or by pressing Ctrl+Shift+7. This dialog is also used for controlling the effect's parameters and for removing effects.

When a path with a path effect applied is selected, the statusbar description mentions that, for example "Path (4 nodes, path effect)".

There is a special Paste Path Effect command (Ctrl+7) that can be used to copy effects from one path to another.

Editing effect parameters

When switching to the node edit tool (F2), the original path can be edited. The original path is shown as a red helper path. Normal path operations, like simplify, still work.

Some parameters of effects can be edited on-canvas. For example, path parameters can be node-edited, by pressing the "edit on-canvas" button in the Path Effects dialog. Press "7" to cycle through the different on-canvas editable parameters. This way, one can edit the parameters without opening the Path Effects dialog. The statusbar tells the name of the parameters that is currently being shown.

Available effects

Path along path

The Path along Path effect can curve a path along another path. When this effect is applied to a path, it can be bend along another path (called bend path). With the node edit tool, both the original path and the bend path can be changed on-canvas and the result is updated live. This provides a direct equivalent of "vector brushes" or "skeletal strokes" features in other vector editors.

In the effect's control panel in the Path Effects dialog, you can select how many copies of the original path are put along the bend path (either single or repeated) and whether it is stretched to fill the bend path. In this dialog you'll also find a button to edit the bend path on-canvas and a button to paste a new bend path from clipboard. A possible workflow is this: you select and copy the new bend path to the clipboard, then select the path you want to bend, apply the Path along path effect, and paste the bend path with the paste button next to 'bend path'.

Example file: live-path-effects-pathalongpath.svg