Giter Club home page Giter Club logo

Comments (4)

oliver-moran avatar oliver-moran commented on September 23, 2024

No specific methods at present - but it's an obvious gap.

You can roll your own using the image.scan method. If you do please send on your code and I'll add it. Or if you know of an open source (preferably MIT licensed) package that has these methods, or just link to the algorithms, then I can add them here.

from jimp.

rustamli avatar rustamli commented on September 23, 2024

Thanks for your reply @oliver-moran

Having image.scan all we need to manipulate H, S and L are rgbToHsl and hslToRgb functions.

Then increasing hue by 50 would look somewhat like this:

var red = this.bitmap.data[idx];
var green = this.bitmap.data[idx+1];
var blue = this.bitmap.data[idx+2];

var out = utils._rgbToHsl(red, green, blue);
out.h += 50;

var cvrBack = utils._hslToRgb(out.h, out.s, out.l);

this.bitmap.data[idx] = cvrBack.r;
this.bitmap.data[idx+1] = cvrBack.g;
this.bitmap.data[idx+2] = cvrBack.b;

I have implemented rgbToHsl and hslToRgb functions and was able to achieve this:

BEFORE: https://dl.dropboxusercontent.com/u/6434207/other/jimp/lx-cozy--large.png
AFTER: https://dl.dropboxusercontent.com/u/6434207/other/jimp/lx-cozy--large--512.png

I need to test my code more before sharing, I will make a pull request as soon as I put it all together.

P. S. great library btw!

from jimp.

oliver-moran avatar oliver-moran commented on September 23, 2024

Thanks! If you write it, I'll pull it in.

from jimp.

rustamli avatar rustamli commented on September 23, 2024

See #50

from jimp.

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.