Giter Club home page Giter Club logo

Comments (6)

meltingice avatar meltingice commented on June 3, 2024

For the curves() function, you have to specify 4 arguments: a start point, 1st control point, 2nd control point, and end point.

Not sure what you mean by "adjusting the value of the colors," could you elaborate a bit?

from camanjs.

bebraw avatar bebraw commented on June 3, 2024

For the curves() function, you have to specify 4 arguments: a start point, 1st control point, 2nd control point, and end point.
Not sure what you mean by "adjusting the value of the colors," could you elaborate a bit?

Basically I'm trying to port a color filter from a GIMP plugin.

The original code looks like this:

(gimp-curves-spline draw  HISTOGRAM-VALUE 8 #(0 0 68 64 190 219 255 255))
(gimp-curves-spline draw  HISTOGRAM-RED   8 #(0 0 39 93 193 147 255 255))
(gimp-curves-spline draw  HISTOGRAM-GREEN 6 #(0 0 68 70 255 207))
(gimp-curves-spline draw  HISTOGRAM-BLUE  6 #(0 0 94 94 255 199))

Apparently value maps to overall brightness. As you can see some of those channels have just three pairs of control points. Any idea how to work around these issues?

Thanks for the prompt feedback by the way. :)

from camanjs.

meltingice avatar meltingice commented on June 3, 2024

Hmm... I may be wrong, but at first look I think the same effect can be achieved if the middle two control points have the same coordinate.

Caman("#image", function () {
  this.curves('g', [0, 0], [68, 70], [68, 70], [255, 207]);
  this.render();
});

This is something that can be built into the curves() function in the future by checking for the # of arguments.

from camanjs.

bebraw avatar bebraw commented on June 3, 2024

Hmm... I may be wrong, but at first look I think the same effect can be achieved if the middle two control points have the same coordinate.

Oh, right. That's definitely true.

This is something that can be built into the curves() function in the future by checking for the # of arguments.

Cool. I'll write a patch for you that does that.

Any idea how to deal with that value bit? I can probably live without that, though.

from camanjs.

meltingice avatar meltingice commented on June 3, 2024

Not too sure... I would need to either see examples of what it's doing or play around with it myself in GIMP.

from camanjs.

bebraw avatar bebraw commented on June 3, 2024

Not too sure... I would need to either see examples of what it's doing or play around with it myself in GIMP.

Ok. No probs. If I figure that out, I'll contribute a patch.

Going to close this issue given we managed to sort the issue out. Now to get that patch underway. :)

from camanjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.