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

GradientImage and other paint functions not exposed? #157

Closed
gavbaa opened this issue Mar 17, 2018 · 6 comments
Closed

GradientImage and other paint functions not exposed? #157

gavbaa opened this issue Mar 17, 2018 · 6 comments

Comments

@gavbaa
Copy link
Contributor

gavbaa commented Mar 17, 2018

There are several functions marked as MagicExport in paint.c that don't have a correlating method to get to them in this Go adapter. Is there a reason they're not exposed? Alternatively, is there a way that a user should call them otherwise?

In my particular case, I know that ReadImage("black-white") will call GradientImage, but there's no way to assign artifacts to a MagickWand, and the artifacts needs to exist on the Image itself (setting artifacts on an empty wand will error). But ReadImage creates a new image and then calls GradientImage immediately, so there's no way to set the artifacts using that workflow. So I guess the alternative question is, if GradientImage can't be exposed directly, is there a way to SetImageArtifact such that ReadImage can use them via the Go binding?

@justinfx
Copy link
Member

If it is part of the ImageMagick 7 api then it is likely to be something that just wasn't exposed when the bindings were updated to support 7. We can expose missing api that is in the ImageMagick headers

@gavbaa
Copy link
Contributor Author

gavbaa commented Mar 17, 2018

It's existed since ImageMagick 6, https://github.com/ImageMagick/ImageMagick/blob/ImageMagick-6/magick/paint.c#L426 . It looks like there might be some other types that will have to be exposed as well, as the method signature includes GradientType, SpreadMethod and PixelPacket.

@justinfx
Copy link
Member

justinfx commented Mar 17, 2018 via email

@gavbaa
Copy link
Contributor Author

gavbaa commented Apr 2, 2018

I've put up a pull request in #162 that maps this function as it is in IM6. The signature is different for IM7 ( https://github.com/ImageMagick/ImageMagick/blob/master/MagickCore/paint.c#L404 ), but if needed to accept the patch I could explore a version for that branch as well.

@justinfx
Copy link
Member

justinfx commented Apr 2, 2018

I can try and test this against im7 this weekend

@justinfx
Copy link
Member

justinfx commented Jan 4, 2020

Was going through these open issues and realised I never followed up on this. I ended up implementing the gradient support for im7. It was definitely a different API, although it has more control since you can have arbitrary color stops.

@justinfx justinfx closed this as completed Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants