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

how to call vips_addalpha() #116

Closed
Martinay opened this issue Feb 18, 2021 · 3 comments
Closed

how to call vips_addalpha() #116

Martinay opened this issue Feb 18, 2021 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@Martinay
Copy link

The vips library has the vips_addalpha () function.
https://libvips.github.io/libvips/API/current/libvips-conversion.html#vips-addalpha

Is it possible to use this function with the .Net Binding?

I only found a binding for the method vips_image_hasalpha () and a similar issue for the ruby binding libvips/ruby-vips#168 .

I added for now the workaround mentioned in the ruby binding

var maxAlpha = (editImage.Interpretation == Enums.Interpretation.Grey16 || editImage.Interpretation == Enums.Interpretation.Rgb16)
                            ? 65535
                            : 255;
editImage = editImage.BandjoinConst(new [] { maxAlpha });

Thank you for your help and this amazing library.

@kleisauke kleisauke added the enhancement New feature or request label Feb 23, 2021
@kleisauke kleisauke added this to the 2.0.0 milestone Feb 23, 2021
@kleisauke
Copy link
Owner

Hi @Martinay,

You're right, this convenience function was missing. I just added it with commit 81dbca8.

If you want to test this, you can use the nightly version of NetVips. Add the https://ci.appveyor.com/nuget/net-vips feed in the <packageSources> section of your NuGet.config:

<packageSources>
  <add key="netvips-nightly" value="https://ci.appveyor.com/nuget/net-vips" />
</packageSources>

And update NetVips to 2.0.0 (build number 248 - prerelease). This will be part of the v2.0.0 release.

@Martinay
Copy link
Author

Great :) . Thank you very much for your help

@kleisauke
Copy link
Owner

NetVips v2.0.0 is now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants