Comments (4)
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.
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.
Thanks! If you write it, I'll pull it in.
from jimp.
See #50
from jimp.
Related Issues (20)
- Error reading arraybuffer in production environment HOT 1
- Share some examples of how to use it.(Multi page tiff from multiple images)
- @jimp/png won't work with @jimp/custom HOT 1
- .brightness() method does not affect brightness
- Upgrade dependancy version of xml2js HOT 1
- Save to specific width and height in inches HOT 1
- Jimp.decoders is undefined in browser with webpack and typescript HOT 1
- ERR_PNPM_NO_MATCHING_VERSION No matching version found for @jimp/plugin-scale@^0.22.12
- zlib_bindings problem when used in Vite with Typescript HOT 1
- Do anyone can run jimp in latest reactjs project? HOT 1
- Unable to get it working in a Vue project. HOT 4
- [BUG] Error when using ES Modules with Jimp HOT 7
- Cannot load fonts in Web Worker HOT 1
- Japanese characters not able to write and render image
- Unable to install jimp library through npm bcz of vulnerabilities checks HOT 3
- Update phin version HOT 9
- Reading base64 image from a Buffer is slow HOT 2
- nvm sorry my bad
- problem with the file path when reading the file HOT 1
- autocrop cropEmpty: true HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jimp.