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 Use Caman.Convert #216

Open
Seikon opened this issue May 28, 2017 · 1 comment
Open

How to Use Caman.Convert #216

Seikon opened this issue May 28, 2017 · 1 comment

Comments

@Seikon
Copy link

Seikon commented May 28, 2017

Hi!

I am trying to convert an image from rgb to hsv using Caman.Convert, but i don't find enough documentation how to use it and import the needed modules.

Can anyone show an example of how to use Caman.Convert?

Thank you.

@flashpuller
Copy link

flashpuller commented Jul 20, 2018

Seems developers forgot to add Caman.Convert declaration in their code, so it should look like Caman.Convert =Convert = (function() {.....

then something like

Caman = require('caman.full.js').Caman;
Convert = Caman.Convert;

Caman.Filter.register('someFilter', function () {
    this.process('someFilter', function (rgba) {
            var hsv = Convert.rgbToHSV(rgba.r, rgba.g, rgba.b);
            var out= Convert.hsvToRGB(hsv.h, hsv.s, hsv.v);
        }
        // Return the modified RGB values
        return out;
    });
});

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