Skip to main content
Image Optimization August 3, 2026 · 5 min read

How to Blur Part of an Image: Faces, Plates, and Sensitive Areas

Privacy laws, social media policies, and common courtesy often require hiding identifiable information in photos. Whether it's a face in the background, a car's license plate, or an address visible in a screenshot — blurring specific areas is a skill worth knowing.

Why Blur Part of an Image?

Privacy protection

When sharing photos publicly, you may capture bystanders, children, or private property — blurring faces protects their identity.

GDPR & privacy compliance

Publishing photos of identifiable individuals in the EU without consent may violate GDPR. Blurring is an accepted anonymisation method.

Security

License plates, home addresses, email addresses, and card numbers visible in screenshots should be blurred before sharing.

Aesthetics

Blurring a distracting background draws the viewer's eye to the subject — similar to the bokeh effect in portrait photography.

Types of Image Blur

Type Best for Reversible?
Gaussian blur Faces, general anonymisation No
Pixelation License plates, strong anonymisation No
Box blur Fast preview blurring No
Frosted glass overlay UI mockups, preview censors Yes (CSS only)

Once a blur is baked into a rasterized image (JPG/PNG), the original information cannot be recovered. Always work from a copy of the original.

Blur Specific Regions in Code

Python (Pillow)

from PIL import Image, ImageFilter

img = Image.open('photo.jpg')

# Define region to blur: (left, top, right, bottom)
region = img.crop((100, 50, 300, 250))
blurred_region = region.filter(ImageFilter.GaussianBlur(radius=15))
img.paste(blurred_region, (100, 50))

img.save('photo_blurred.jpg')

JavaScript (Canvas API)

const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
canvas.width  = img.width;
canvas.height = img.height;

// Draw original
ctx.drawImage(img, 0, 0);

// Blur only a region using an offscreen canvas
const offscreen = document.createElement('canvas');
const octx = offscreen.getContext('2d');
offscreen.width  = img.width;
offscreen.height = img.height;
octx.filter = 'blur(20px)';
octx.drawImage(img, 0, 0);
octx.filter = 'none';

// Copy blurred region onto main canvas
ctx.drawImage(offscreen, 100, 50, 200, 200, 100, 50, 200, 200);

How Strong Should the Blur Be?

The effectiveness of blur depends on the original image resolution and the size of the object being hidden:

Light blur (2–10px)

Aesthetic softening, background defocus. Not enough to anonymise faces.

Moderate blur (15–30px)

Good for most privacy use cases — faces become unrecognisable at typical viewing sizes.

Heavy blur (40–80px)

Maximum anonymisation for high-resolution images or small details like number plates.

Pixelation

Reduces region to large blocks — extremely strong anonymisation, often used in news photography.

Blur faces or regions manually — free