Giter Club home page Giter Club logo

depixelate's Introduction

Depixelate

Upscaling and enhance low resolution images.

Usage

First of all, you might want to check out the Online Demo. Once done, let's code.

$ pip install depixelate
import cv2
import depixelate

original_image = cv2.imread('image.jpg')

result = depixelate.apply(original_image, 7, 600)

Params

The apply method accepts 3 parameters:

  • Image (Required): Original image to be changed.
  • Weight (Optional): Indicates the power of the gaussian-blur algorithm. The higher the value, the more shape distortion. It must be between 1 and 10. Default value is 6.
  • Width Scale (Optional): Indicates the width of the output image. Default value is 800.

Limitations

Depixelate library helps with logos and some graphics, but it doesn't help when maximum sharpness and detail is needed.
In the majority of cases, you'll want to improve the quality of low resolution images (about 300 pixels wide or less). Otherwise you might be a little disappointed.

Plans

depixelate's People

Contributors

vilmacio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

depixelate's Issues

https://depixelate-api.herokuapp.com down

Nevermind -- the heroku app is down.

--

When I upload the image I get a CORS error in both Firefox and Chrome, it says: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://depixelate-api.herokuapp.com/. (Reason: CORS request did not succeed)

I think it's because the herokuapp doesn't respond with the correct access-control-allow-origin header.

Error when running

Traceback (most recent call last):
File "C:\M-Tech\projects\mtech\lib\site-packages\PIL\Image.py", line 3231, in open
fp.seek(0)
AttributeError: 'numpy.ndarray' object has no attribute 'seek'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\M-Tech\projects\ESRGAN\deblur.py", line 6, in
result = depixelate.apply(original_image, 7, 600)
File "C:\M-Tech\projects\mtech\lib\site-packages\depixelate.py", line 10, in apply
pil_image = Image.open(image).convert('RGBA')
File "C:\M-Tech\projects\mtech\lib\site-packages\PIL\Image.py", line 3233, in open
fp = io.BytesIO(fp.read())
AttributeError: 'numpy.ndarray' object has no attribute 'read'. Did you mean: 'real'?

Colors are burned (and blue and red channel are swapped)

image

Is it the intended behaviour? I edited out the blue and red channel swap by reconverting the end result, can I ask what's the reason it is needed without digging too much?

I'd like to ask the same question for the color channels being handled as maxed or empty instad of inbetween values.

Thanks

ModuleNotFoundError: No module named 'PIL'

When I try to import the module, I get an error.

$ python
>>> import depixelate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/andrew/.asdf/installs/python/3.10.7/lib/python3.10/site-packages/depixelate.py", line 5, in <module>
    from PIL import Image
ModuleNotFoundError: No module named 'PIL'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.