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

Added Image.alpha_channel property #35

Merged
merged 1 commit into from Aug 15, 2012
Merged

Conversation

@pflorczyk
Copy link
Contributor

@pflorczyk pflorczyk commented Aug 14, 2012

Allows to get/set alpha channel.

@travisbot
Copy link

@travisbot travisbot commented Aug 14, 2012

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

@dahlia
Copy link
Collaborator

@dahlia 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
Copy link
Contributor Author

@pflorczyk 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 issue Aug 15, 2012
Added Image.alpha_channel property
@dahlia dahlia merged commit ff3287e into emcconville:master Aug 15, 2012
1 check passed
dahlia added a commit that referenced this issue Aug 15, 2012
dahlia added a commit that referenced this issue Aug 15, 2012
dahlia added a commit that referenced this issue Aug 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants