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

Added Image.alpha_channel property #35

Merged
merged 1 commit into from Aug 15, 2012

Conversation

3 participants
@pflorczyk
Contributor

pflorczyk commented Aug 14, 2012

Allows to get/set alpha channel.

@travisbot

This comment has been minimized.

travisbot commented Aug 14, 2012

This pull request passes (merged 4cfd8ed into 144add4).

@dahlia

This comment has been minimized.

Collaborator

dahlia commented Aug 15, 2012

There seems more ways to represent alpha channel than only two, but your code treats it as just boolean state. Can you elaborate?

@pflorczyk

This comment has been minimized.

Contributor

pflorczyk commented Aug 15, 2012

I think that most common operation on alpha channel will be enabling/disabling it. It is aliased as on/off in convert utility (http://www.imagemagick.org/script/command-line-options.php#alpha).
I also consider it to be more readable in simlpe usage scenarios:

with Image(filename="IMG.png") as img:
    img.alpha_channel=False # the same as running convert with option -alpha off

instead of:

with Image(filename="IMG.png") as img:
    img.alpha_channel="deactivatealphachannel" # assumes you know the internals
    #or
    img.alpha_channel=ALPHA_CHANNEL_TYPE.index("deactivatealphachannel")

For more advanced usage there should be set_alpha_channel() method.

dahlia added a commit that referenced this pull request Aug 15, 2012

Merge pull request #35 from pflorczyk/master
Added Image.alpha_channel property

@dahlia dahlia merged commit ff3287e into emcconville:master Aug 15, 2012

1 check passed

default The Travis build passed
Details

dahlia added a commit that referenced this pull request Aug 15, 2012

dahlia added a commit that referenced this pull request Aug 15, 2012

dahlia added a commit that referenced this pull request Aug 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment