Coder Social home page Coder Social logo

'module' object is not callable about pilgram2 HOT 5 CLOSED

sugizo avatar sugizo commented on August 26, 2024
'module' object is not callable

from pilgram2.

Comments (5)

mgineer85 avatar mgineer85 commented on August 26, 2024

How are your imports looking? Can you share the complete script?

from pilgram2.

sugizo avatar sugizo commented on August 26, 2024

env
google colab

code (undocumented about brightness but work, see pic above)

!wget -c 'https://i.ytimg.com/vi/vEYsdh6uiS4/maxresdefault.jpg'
pip install -U pilgram2 matplotlib pillow
from PIL import Image
from google.colab import files, drive
import matplotlib.pyplot as plt
import pilgram2
import pilgram2.css
import pilgram2.css.blending
ori_img = 'maxresdefault.jpg'

im = Image.open(ori_img)
filtered_css_img = 'brightness.png'
pilgram2.css.brightness(im).save(filtered_css_img)
fig = plt.figure(figsize = (22, 22) )
plt.subplot(1, 2, 1)
plt.title("original")
plt.imshow(im)
plt.subplot(1, 2, 2)
plt.title("brightness")
image0 = plt.imread(filtered_css_img)
plt.imshow(image0)

code that not work above

!wget -c 'https://i.ytimg.com/vi/vEYsdh6uiS4/maxresdefault.jpg'
pip install -U pilgram2 matplotlib pillow
from PIL import Image
from google.colab import files, drive
import matplotlib.pyplot as plt
import pilgram2
import pilgram2.css
import pilgram2.css.blending
ori_img = 'maxresdefault.jpg'

im = Image.open(ori_img)blended_img = 'alpha.png'
filtered = Image.open(filtered_img)
filtered_css = Image.open(filtered_css_img)
pilgram2.css.blending.alpha(filtered, filtered_css).save(blended_img)

best regards

from pilgram2.

mgineer85 avatar mgineer85 commented on August 26, 2024

pilgram2.css.blending.alpha is the internal method that is used.
For external use you need to use one of the other methods that describes the blending method like pilgram2.css.blending.normal or .darken

Could be helpful to have a look at the test methods also.
Does this help?

from pilgram2.

sugizo avatar sugizo commented on August 26, 2024

how about nonseparable ?
e.g.
pilgram2.css.blending.nonseparable(filtered, filtered_css).save(blended_img)

best regards

from pilgram2.

mgineer85 avatar mgineer85 commented on August 26, 2024

Nonseparable also not considered as blendmode and internal.

from pilgram2.

Related Issues (3)

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.