"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "inkscape-0.46/doc/inkscape-shadow.README" of archive inkscape-0.46.zip:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 == BLURRED SHADOWS VIA BITMAPS
    2 
    3 The "Make a Bitmap Copy" command (Alt+B) exports a bitmap of 
    4 the selected objects (with all other objects hidden), saves it as a 
    5 PNG file in the same directory as the document, and imports it 
    6 back into the document.
    7 
    8 Via prefs, you can specify an external filter that will be run on the
    9 PNG file after it is exported but before it is imported back. I use
   10 this for grayscaling and blurring the image to create a soft drop
   11 shadow for any object. So for me, Alt+B creates a shadow for
   12 selected objects, and you can set it up to work the same for you.
   13  
   14 The script itself is share/extensions/inkscape-shadow.sh, though 
   15 it's not integrated nto the extensions or plugin system in any way. 
   16 The script requires Imagemagick 6.x to be installed; you can 
   17 modify the script as you like, probably adapting it for effects
   18 other than shadows. The script is Unix-only; you can create
   19 a similar batch file for Windows if you need it (send it to us
   20 if you do).
   21  
   22 To enable this, you set in your ~/.inkscape/preferences.xml:
   23  
   24     <group
   25         id="createbitmap"
   26         minsize="250"
   27         filter="/full/path/to/inkscape-shadow.sh"
   28         filter_param1="20" />
   29 
   30 Here minsize= gives the minimum size of the generated bitmap in 
   31 pixels (regardless of the object size); alternatively you can specify 
   32 resolution= to set the constant resolution (different pixel size
   33 for different object sizes).
   34  
   35 In filter=, you specify either the full path to the script, or just
   36 "inkscape-shadow.sh" if the script is in your PATH. The script
   37 receives the image filename as the first parameter and the
   38 filter_param1 as the second parameter (more parameters can be 
   39 added). This particular script interprets that as the blur radius 
   40 in pixels, but of course that depends on the script you use.
   41 
   42 The inkscape-shadow-white.sh script is the same but creates all-white
   43 blurred shadows ("glows") instead of all-black.
   44  
   45 NOTE: I'm not going to provide a GUI for the blurred shadows feature,
   46 for these reasons:
   47  
   48  1. You have to carry around the shadow PNGs along your SVG. It's
   49  inconvenient, and the PNGs may be much larger than the SVG.
   50  
   51  2. The shadows are not resolution-independent and are not updated
   52  automatically. For all this, we need to support the gaussian blur SVG
   53  filter (a standard SVG feature). But since we don't have any filter
   54  support yet, hence this hack.
   55  
   56  3. Both Batik and Adobe have (different) problems with displaying PNGs
   57  with alpha transparency. (Much like the Internet Exploder - shame on
   58  them! :) This means that while this is valid SVG, its usefulness is
   59  pretty much limited to Inkscape only.
   60  
   61 Still, for those who desperately need blurred shadows right now (such
   62 as myself), this feature works well enough. Try it out, it's fun.
   63