Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding method for painting a color in transparent #98

Merged
merged 4 commits into from Mar 14, 2013

Conversation

@lkoenig
Copy link
Contributor

@lkoenig lkoenig commented Mar 10, 2013

Hello,
I have added a wrapper around the method MagickTransparentPaintImage: wand.image.Image.transparent_color to be able to make a color transparent in an image.

Regards,
Lionel

@dahlia
Copy link
Collaborator

@dahlia dahlia commented Mar 10, 2013

Thanks for your patch! Could you write some tests for this method?

@lkoenig
Copy link
Contributor Author

@lkoenig lkoenig commented Mar 11, 2013

Hi,

I will try but I experienced difficulties to run the test suit on my computer. I have already written a test but I don`t know if it pass or not as I can't figure out how to execute it ;-)

Regards,

Lionel


@tests.test
def transparent_paint():
"""TransparentPaint test"""
with Image(filename=asset('rotatetest.gif')) as img:
img.alpha_channel = True
with Color('white') as white:
img.transparent_paint(white, 0.0, 2, 0)
with img.channel_images['alpha'] as alpha_image:
assert alpha_image[75, 50] == 0.0

assert alpha_image[0, 50] == 1.0

Le 10 mars 2013 à 13:55, Hong Minhee a écrit :

Thanks for your patch! Could you write some tests for this method?


Reply to this email directly or view it on GitHub.

@dahlia
Copy link
Collaborator

@dahlia dahlia commented Mar 12, 2013

You can run tests by: python setup.py test command.

@dahlia
Copy link
Collaborator

@dahlia dahlia commented Mar 12, 2013

And it seems to currently fail:

Traceback (most recent call last):
  File "/usr/lib/python2.6/contextlib.py", line 34, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/lib/python2.6/contextlib.py", line 113, in nested
    yield vars
  File "wandtests/image.py", line 776, in transparent_paint
    img.transparent_paint(white, 0.0, 2, 0)
AttributeError: 'Image' object has no attribute 'transparent_paint'

@lkoenig
Copy link
Contributor Author

@lkoenig lkoenig commented Mar 13, 2013

The test shoul pass now. sorry for the delay at least on my computer.

@dahlia
Copy link
Collaborator

@dahlia dahlia commented Mar 13, 2013

It still fails on CPython 2.7 (but passes on CPython 2.6 and PyPy 1.9): see the details. You can run tests on all Python VMs we should support using tox:

$ pip install tox
$ tox

@lkoenig
Copy link
Contributor Author

@lkoenig lkoenig commented Mar 13, 2013

That does not fail on my test ;-)

Lionel

Le 13 mars 2013 à 22:38, Hong Minhee a écrit :

It still fails on CPython 2.7 (but passes on CPython 2.6 and PyPy 1.9): see the details. You can run tests on all Python VMs we should support using tox:

$ pip install tox
$ tox

Reply to this email directly or view it on GitHub.

@dahlia
Copy link
Collaborator

@dahlia dahlia commented Mar 14, 2013

@lkoenig Oh it was a problem of Travis side.

dahlia added a commit that referenced this issue Mar 14, 2013
Adding method for painting a color in transparent
@dahlia dahlia merged commit 7ecfe3f into emcconville:master Mar 14, 2013
1 check passed
dahlia added a commit that referenced this issue Mar 14, 2013
dahlia added a commit that referenced this issue Mar 14, 2013
dahlia added a commit that referenced this issue Mar 14, 2013
dahlia added a commit that referenced this issue Mar 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants