whoami

Lucas Jenß

cat /etc/motd

The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.

Close-up of white dominoes with black dots standing on green felt surface, shallow depth of field, focused mood

ls -la ~/languages/

total 8
drwxr-xr-x
▶ PHP
▶ Ruby
▶ Scala
▶ C#
▶ JavaScript
▶ Objective-C
▶ Shell Scripting

ls -la ~/toolchain/

total 7
drwxr-xr-x
▶ Typo3
▶ Akka
▶ Capistrano
▶ Git
▶ MAMP
▶ Adobe Illustrator
▶ NSTrackingArea (Cocoa)

uname -a

platforms
drwxr-xr-x
▶ Mac OS X
▶ Unix

Realistic SVG drop shadows in Illustrator

A convincing drop shadow does more than blur a duplicate of an object. It suggests a surface, a light source and a believable distance between foreground and background. That is why a quick, uniform grey blur can look cheap, while a carefully tuned shadow gives a logo, card or interface element physical presence without sacrificing the clean edges of vector artwork.

Illustrator's familiar Effects panel can make a serviceable shadow in seconds, but SVG filters offer finer control over blur, offset, opacity and shadow layering. They also travel with the artwork as markup, which makes them useful for web assets, responsive graphics and clients who need the file to behave consistently outside the studio. The practical approach is to build one reusable filter, test it under real conditions and apply it like any other appearance.

Why SVG filters suit vector artwork

An SVG filter is a small pipeline of operations. The source artwork supplies its alpha channel, feGaussianBlur softens that shape, feOffset moves it, a colour operation sets the shadow tone and opacity, and feMerge places the original artwork back over the shadow. The result stays editable in Illustrator and can be exported as live SVG rather than being trapped in a flattened bitmap.

That pipeline gives you more control than a single slider. For instance, you can create a tight contact shadow and a broad ambient shadow with different offsets and blur radii, then merge both beneath the source graphic. This extra modelling is what separates a believable raised element from a sticker-like blur. It also keeps the artwork scalable, so the same filter can serve a business card and a large-format sign without pixelation. Since an SVG filter is code as much as artwork, it sits neatly beside creative programming. Mike Meredith's creative coding notes make that connection useful: small, testable parameters often beat a pile of opaque controls, so change one value, inspect the result and keep it only when the illusion improves.

Building a reusable shadow filter

In Illustrator, open the Appearance panel and choose Apply SVG Filter from its panel menu, then double-click the applied filter to edit its primitives. Start with a modest filter region—often 150 to 200 per cent of the object's bounds—rather than an enormous canvas. The region must contain the blurred and offset shadow; if it is too small, the edge will be clipped. For a logo or wordmark, check the region in object bounding box units, because a tight bounding box can cut off a diagonal shadow.

Build the filter in two layers. A near-black flood gives the shadow its colour; compositing it through the offset alpha masks it to the object's silhouette. A second, wider blur can form ambient depth, while a smaller blur close to the artwork forms a contact shadow. Merge the shadows first and the source artwork last. Keeping that order is important: a source drawn over the shadow preserves crisp edges and prevents the shadow from appearing in front.

Save the filter as a reusable entry, then duplicate the object and adjust the source graphic while the appearance remains linked. If a client asks for several button states, changing the geometry should not mean rebuilding every shadow by hand. On a grouped symbol, however, test the filter around the visible bounds; hidden or oversized groups can distort the region and make the blur look unexpectedly heavy. For predictable results, work with clean paths, expanded strokes and sensible group bounds rather than an arbitrary artboard-sized selection.

Matching light, distance and softness

A realistic shadow follows one imagined light source. If the light falls from the upper left, move the shadow down and right; if it comes from above and slightly behind, use a smaller vertical offset and more vertical blur. The shadow should never feel unrelated to highlights, bevels or background geometry. Before adding complexity, place the artwork in its final context, because a shadow that looks convincing on white can disappear on a coloured panel or become distracting on a busy photograph.

Distance controls apparent elevation. A raised sticker needs a narrow, dark contact shadow close to its edge. A panel floating above a wall needs a broader, softer cast shadow farther away. Increase blur and reduce opacity as the shadow moves farther from the object, rather than making the far shadow equally dark. Two restrained layers usually work better than one dramatic effect: a soft ambient shadow at roughly 10 to 20 per cent opacity and a tighter contact shadow at perhaps 20 to 35 per cent, then tune to the artwork.

Australian conditions make this especially relevant. Outdoor signage in Queensland can sit under hard, high-contrast sun, where a convincing shadow quickly exposes an effect that is too soft; artwork intended for a Melbourne café wall may need gentler diffusion under changing daylight. In a Sydney pitch, a designer may simply call a well-balanced result “a beauty”, but the client still needs the same filter to survive print, screen and signage. Keep the artistic intent while changing the shadow parameters for each application.

Testing Illustrator, SVG and browser output

Test at three stages: in Illustrator, in a browser and in the final application. Keep the SVG filter markup visible in exported code, open it in current versions of Chrome, Firefox and Safari, and inspect the result at the intended pixel size. Browser zoom and device pixel ratio can reveal banding or edge clipping that is hard to see on a high-resolution monitor. A reduced-size thumbnail is also worth checking, because excessive blur tends to merge into a grey patch at small dimensions.

Production validation matters here too. The PHP address validation article on The Coding Journal shows how a precise rule can protect a downstream workflow; similarly, test the filter against the oldest browser or design application your client actually uses. A clean preview in Illustrator is not proof that unsupported filter primitives will render elsewhere. Record the export settings, and compare the live SVG with a flattened reference image.

Be careful with print workflows. Some PDF export paths rasterise SVG-filtered objects, while expanded appearances can remove the filter but alter the artwork. For a printer, supply a flattened PDF proof alongside the live AI and SVG files, and state which version is the production master. If the filter uses an uncommon primitive, confirm it in a browser and provide a raster fallback. This avoids handing over a file that opens perfectly on the designer's screen but fails at the sign shop.

A practical client delivery checklist

Delivery in Australia often means the same artwork must serve several buyers. A Melbourne agency may send a layered AI file to a local printer, a Sydney client may publish the SVG on a website, and the end client may need transparent PNGs for a Canva-style template. Quotations are commonly issued in Australian dollars with 10 per cent GST identified, so package the files clearly enough that the client can choose the appropriate format without another round of admin.

Before sign-off, run this short review against the actual deliverables rather than only admiring the open Illustrator document:

  • Save a named SVG filter with sensible offsets, blur values and opacity, then apply it consistently to every related object rather than recreating it by hand.
  • Inspect the live SVG in target browsers and at final display size, including a small thumbnail, to catch clipping, banding and unexpectedly soft edges.
  • Export a flattened PDF proof for print alongside the editable AI and SVG masters, noting which file the printer should use.
  • Include transparent PNG fallbacks where a client's tool or production process cannot support SVG filters, and test colour and shadow placement on both light and dark backgrounds.

Create one reusable shadow filter today, place it over a real logo on its intended background, and export the SVG for a browser test. That short loop—design, export, inspect and refine—will give your next Illustrator project cleaner edges and a shadow people read as depth rather than decoration.


cat ~/interests.json

KeyValue
editorTerminal-first workflow
osMac OS X / Unix
vcsGit, distributed version control
deployCapistrano, cron automation
graphicsSVG, Adobe Illustrator troubleshooting
networkingIP validation, SSH, VPN

git log --oneline --reverse

2013-10-30

Solving SVG import issues in Adobe Illustrator CS6 and CC

When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.

2013

Solving NDK build issues on OS X

Troubleshooting native development kit compilation problems on Mac OS X.

2013

Programmatically adding PHP generated TypoScript to the backend configuration

Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.

2013

ArgumentError: Could not parse PKey: no start line

Debugging an SSH key parsing error encountered during deployment.

2011-08-04

Validating IP-Addresses in PHP

Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.

2011-07-09

Cocoa: Using NSTrackingArea

A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.


cat ~/contact.txt

github: github.com/x3ro
stackoverflow: x3ro
coderwall: coderwall.com/x3ro
twitter: @x3rames