Skip to main content

Python library which wraps 61315's pure C implementation of resynthesizer (open-source Content-Aware Fill equivalent)

Usage:

from resynthesizer import resynthesize
from PIL import Image

source = Image.open('source.jpg')
# mask must have black background, white foreground
mask = Image.open('mask.png')
result = resynthesize(source, mask)
result.save('result.jpg')

You can adjust resynthesizer's params if you want:

from resynthesizer import TImageSynthParameters

# defaults
params = TImageSynthParameters()
params.isMakeSeamlesslyTileableHorizontally = 1
params.isMakeSeamlesslyTileableVertically = 1
params.matchContextType = 1
params.mapWeight = 0.5
params.sensitivityToOutliers = 0.117
params.patchSize = 30
params.maxProbeCount = 200

...

result = resynthesize(source, mask, parameters=params)

Package repo: https://github.com/light-and-ray/resynthesizer-python-lib Pure C Implementation repo: https://github.com/61315/resynthesizer Original repo: https://github.com/bootchk/resynthesizer

Metadata

Release files for resynthesizer 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resynthesizer 1.2
File Size Uploaded
resynthesizer-1.2.tar.gz 118.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for resynthesizer 1.2
File Interpreter ABI Platform
resynthesizer-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 238.0 kB

Release files / resynthesizer-1.2.tar.gz

Download URL resynthesizer-1.2.tar.gz
Size 118.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4bdd36eae4a98c950d3256dec661f0aacd78bd0a0a027ce24b0dbee4545e96b9
BLAKE2b-256 checksum
How to use checksums
b78f3832268091f24f52345e5ee4a5af1598e22aa2e26fddf504e46df193b6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.6

Release files / resynthesizer-1.2-py3-none-any.whl

Download URL resynthesizer-1.2-py3-none-any.whl
Size 119.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cac3a4bf43cffddea32294f319731407b89a4dbe6ce26ce472620ab4af78f9bb
BLAKE2b-256 checksum
How to use checksums
1c9f9a7805ab1535b952762b050a76c2da83b950c00a8535929a589ec0b14dbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files

1.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page