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 |
---|---|---|
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bfscale-0.1.1.tar.gz
.
File metadata
- Download URL: bfscale-0.1.1.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33dca6fc115054a0b121f551bd5fd2772c74807d1bdeabda7ea36d3554666b26 |
|
MD5 | 4de23cca3d049b2911b0f11a70efc59e |
|
BLAKE2b-256 | 19ab0f45be1b2a6ad6ba12f9b43da4997980d2fb58be6058ace62995b14614cd |
File details
Details for the file bfscale-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: bfscale-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bbd9c63cc2f4c480df615b7722edf63e6c43295abcfc579836ce235eb744837 |
|
MD5 | 197eb0990ca869fef5770d0a5c7531e1 |
|
BLAKE2b-256 | afbd11091fb70166627e06f96980b3d72bbfe6f9a0b5d15a75934701efff999f |