Skip to main content

Best fit image scaling

Project description

bfscale

Best Fit Scale (bfscale) is a image downscaling method to create the highest possible image quality upon upscaling/upsampling with a certain scaling method (in this instance bilinear). This is achieved by fitting the parameters of the upscaling model to sections of the original image. In the case of bilinear, this can be done with a simple linear regression.

Bfscale was originally developed for improved Signed Distance Fields (SDFs), but was separated due to its broader usefulness.

Source: https://github.com/GroveDG/bfscale

PyPi: https://pypi.org/project/bfscale

Dependencies

  • Numpy

How to Use

bfscale only has one function: bfscale.scale(img, scale).

  • Returns an numpy image downscaled by a factor of scale, which must be an integer factor of the image shape.

Image Comparison

Unscaled Bfscale 20% Scale Linear 20% Scale
Billiard Balls A. Unscaled Billiard Balls A. Bfscaled Billiard Balls A. Linear Scaled
Billiard Balls A. Unscaled Cropped Billiard Balls A. Bfscaled Cropped Billiard Balls A. Linear Cropped
Image Source

Copyright (C) 2011-2014 Nicola Asuni - Tecnick.com LTD

The images shown are part of the TESTIMAGES project: http://testimages.tecnick.com

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

bfscale-0.1.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

bfscale-0.1.1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

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