blur

Apply Gaussian blur effect to images with adjustable intensity.

Usage

Terminal
$ mediaproc image blur <input> [options]

Description

The blur command applies a Gaussian blur effect to images using a configurable sigma parameter. Gaussian blur creates a smooth, natural-looking blur by applying a weighted average based on a bell curve distribution. Perfect for background effects, privacy protection, or artistic softening.

Options

OptionTypeDefaultDescription
-s, --sigmanumber10Blur strength (0.3-1000)
-o, --outputpath<input>-blurred.<ext>Output file path
-q, --qualitynumber90Output quality (1-100)
--dry-runflag-Preview changes without executing
-v, --verboseflag-Show detailed output

Sigma Parameter

The sigma value controls blur intensity:

RangeLevelEffectUse Case
0.3-2MinimalVery subtle softeningSlight skin smoothing
2-5LightGentle blur, details visiblePortrait background blur
5-15MediumNoticeable blur (default: 10)General background effects
15-30StrongHeavy blur, shapes visibleBokeh effect, focus emphasis
30-50HeavyVery blurred, colors visiblePrivacy/face obscuring
50+ExtremeAlmost solid colorsAnonymization, abstract effects

Examples

Basic Blur

Terminal
$ mediaproc image blur photo.jpg
✓ Applied blur (sigma: 10)
Terminal
$ mediaproc image blur portrait.jpg -s 3
✓ Light blur applied (sigma: 3)
$ mediaproc image blur background.png -s 15
$ mediaproc image blur screenshot.jpg -s 40

Custom Output

# Save with custom name
mediaproc image blur photo.jpg -o blurred-photo.jpg

# Specify quality
mediaproc image blur image.png -s 20 -q 95 -o result.png

# Different directory
mediaproc image blur pic.jpg -s 10 -o ./blurred/pic.jpg

Batch Processing

# Blur multiple images
mediaproc image blur "photos/*.jpg" -s 15

# With verbose output
mediaproc image blur "backgrounds/*.png" -s 25 -v

# Preview first
mediaproc image blur "images/*.jpg" -s 30 --dry-run

Portrait Background Blur

# Subtle background blur (bokeh effect)
mediaproc image blur portrait-bg.jpg -s 5 -o bokeh.jpg

# Medium depth of field simulation
mediaproc image blur photo-bg.jpg -s 10 -o dof.jpg

# Strong background blur
mediaproc image blur subject.jpg -s 20 -o focused.jpg

Privacy Protection

# Obscure faces in photo
mediaproc image blur faces.jpg -s 40 -o anonymous.jpg

# Blur license plates
mediaproc image blur car-photo.jpg -s 35 -o censored.jpg

# Hide sensitive information
mediaproc image blur document.png -s 50 -o redacted.png

Artistic Effects

# Dreamy soft focus
mediaproc image blur landscape.jpg -s 8 -o dreamy.jpg

# Abstract blur art
mediaproc image blur colorful.png -s 60 -o abstract.png

# Vintage soft look
mediaproc image blur portrait.jpg -s 4 -q 85 -o vintage.jpg

Background Preparation

# Blur background for text overlay
mediaproc image blur hero-bg.jpg -s 20 -o ready-for-text.jpg

# Soften background for UI
mediaproc image blur app-bg.png -s 15 -o soft-bg.png

Blur Strength Guide

Light Blur (1-5)

Use for:

  • Portrait skin smoothing
  • Subtle depth of field
  • Minor background separation
  • Soft focus effects

Example:

mediaproc image blur portrait.jpg -s 3

Medium Blur (5-15)

Use for:

  • General background blur
  • Product photo backgrounds
  • Bokeh simulation
  • Website hero images

Example:

mediaproc image blur background.jpg -s 10

Strong Blur (15-30)

Use for:

  • Clear subject/background separation
  • Emphasizing focus areas
  • Creating depth
  • Dramatic bokeh

Example:

mediaproc image blur scene.jpg -s 25

Heavy Blur (30+)

Use for:

  • Privacy protection
  • Anonymization
  • Censoring information
  • Abstract artistic effects

Example:

mediaproc image blur sensitive.jpg -s 40

Common Use Cases

Portrait Photography:

# Blur background to emphasize subject
mediaproc image blur portrait-background.jpg -s 12 -o bokeh.jpg

Privacy Protection:

# Obscure identifiable features
mediaproc image blur crowd-photo.jpg -s 35 -o anonymous.jpg

Web Design:

# Create soft background for hero section
mediaproc image blur hero-bg.jpg -s 18 -o web-bg.jpg

Product Photography:

# Blur background to highlight product
mediaproc image blur product-scene.jpg -s 8 -o clean-bg.jpg

Document Redaction:

# Hide sensitive information
mediaproc image blur confidential.png -s 45 -o redacted.png

Performance Tips

  • Lower sigma values (1-10) are faster to process
  • Higher sigma values (50+) take more time
  • Blur is relatively fast compared to other operations
  • Processing time increases with both image size and sigma value

Best Practices

  1. Start Small: Test with low sigma and increase gradually
  2. Preview First: Use --dry-run for batch operations
  3. Quality Matters: Use -q 95+ for final outputs
  4. Consider Purpose: Match sigma to use case (privacy vs aesthetics)
  5. Batch Consistently: Use same sigma for related images

Technical Details

Gaussian Blur Algorithm

The blur uses a Gaussian function for weight distribution:

  • Creates smooth, natural-looking blur
  • Weights decrease with distance from center
  • No harsh edges or artifacts
  • Industry-standard algorithm

Edge Handling

Edges are handled by:

  • Extending edge pixels outward
  • Prevents dark borders
  • Maintains image dimensions

Limitations

  • Cannot unblur an already blurred image
  • Very high sigma (greater than 100) may cause artifacts
  • Extreme blur may reduce file size (less detail)
  • Blur cannot be undone after saving

Comparison with Other Effects

CommandEffectUse Case
blurGaussian smoothingGeneral blur
medianNoise reductionPreserve edges while smoothing
sharpenOpposite of blurEnhance details
pixelateBlocky effectPrivacy with different aesthetic

Future Enhancements

These features are planned but not yet implemented:

  • Motion blur: Directional blur simulation (FUTURE)
  • Radial blur: Center-focused blur effect (FUTURE)
  • Smart blur: Edge-preserving blur (FUTURE)
  • Variable blur: Different strength across image (FUTURE)
  • Mask support: Blur only specific regions (FUTURE)

Troubleshooting

Blur not strong enough:

  • Increase sigma value (try 20-30)
  • Ensure command completed successfully
  • Check output file was created

Blur too strong:

  • Decrease sigma value (try 3-8)
  • Cannot undo blur after saving

Processing very slow:

  • Expected with high sigma (50+)
  • Reduce sigma for faster processing
  • Consider image size reduction first

Quality loss:

  • Increase quality setting: -q 95
  • Use PNG for lossless (but larger files)
  • Blur itself doesn't degrade quality (just softens)

Unexpected results:

  • Verify sigma is in valid range (0.3-1000)
  • Check input file isn't already heavily processed
  • Try with verbose mode: -v

See Also

  • median - Edge-preserving blur for noise reduction
  • sharpen - Opposite effect (enhance details)
  • pixelate - Alternative privacy protection
  • gaussian-blur - Alias for blur (same command)

Found an issue? Help us improve this page.

Edit on GitHub →