Skip to main content

A very old open-source "Content-Aware Fill" method

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resynthesizer-1.2.tar.gz (118.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resynthesizer-1.2-py3-none-any.whl (119.3 kB view details)

Uploaded Python 3

File details

Details for the file resynthesizer-1.2.tar.gz.

File metadata

  • Download URL: resynthesizer-1.2.tar.gz
  • Upload date:
  • Size: 118.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.6

File hashes

Hashes for resynthesizer-1.2.tar.gz
Algorithm Hash digest
SHA256 4bdd36eae4a98c950d3256dec661f0aacd78bd0a0a027ce24b0dbee4545e96b9
MD5 072bb10298ddfe2b4c44089e53d63ceb
BLAKE2b-256 b78f3832268091f24f52345e5ee4a5af1598e22aa2e26fddf504e46df193b6e2

See more details on using hashes here.

File details

Details for the file resynthesizer-1.2-py3-none-any.whl.

File metadata

  • Download URL: resynthesizer-1.2-py3-none-any.whl
  • Upload date:
  • Size: 119.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.6

File hashes

Hashes for resynthesizer-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cac3a4bf43cffddea32294f319731407b89a4dbe6ce26ce472620ab4af78f9bb
MD5 19c78ba91b66c0f02b097be330389bb5
BLAKE2b-256 1c9f9a7805ab1535b952762b050a76c2da83b950c00a8535929a589ec0b14dbd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page