Questions tagged [jimp]

Jimp (JavaScript Image Manipulation Program) is an image processing library for Node written entirely in JavaScript, with zero native dependencies.

Jimp (JavaScript Image Manipulation Program) is an image processing library for Node written entirely in JavaScript, with zero native dependencies.

104 questions
1
vote
1 answer

How to resize an image proportionally using a blur effect, instead of letterboxing, on Node.js?

I have a photo which is a rectangle and I want to resize it down to a square while preserving the aspect ratio. Libraries like Sharp allow you to do that by applying letterboxing to the resulting image. await sharp(photoBuffer).resize({ width: 200,…
Kawd
  • 4,122
  • 10
  • 37
  • 68
1
vote
0 answers

How can I tint an image to reach a desired average RGB on Node.js using Jimp?

I have a coloured (or b&w) image as a Base64 string I have a target RGB I want to tint that image so that when it is resized down to a much smaller size, it's average RGB gets pretty close to my target RGB You can see the below code in action…
Kawd
  • 4,122
  • 10
  • 37
  • 68
1
vote
0 answers

How to print emojis in Jimp - Node Js | Jimp

I'm building a nodejs app that generates tweets by text and some of the target tweets contain emojis in text or in user name. But when I try to print those emojis in Jimp, it converts the emoji into "??". I already tried to use "NotoColorEmoji" and…
script.igor
  • 61
  • 1
  • 1
  • 5
1
vote
0 answers

Error Could not find MIME for Buffer Jimp

Hi I'm trying to send an image buffer through http between servers, from server A to server B. My Server B snippet goes like this: app.post('/image', (req, res) => { Jimp.read(Buffer.from(req.body.buffer.data)) .then(image => { …
Clown
  • 183
  • 1
  • 10
1
vote
0 answers

Why doesn't this Jimp gif generator work?

My goal is a module that generates rainbow gifs out of a single image. I don't understand why this code doesn't work. Could anyone help? Thanks! var Jimp = require('jimp'); var getPixels = require('get-pixels') var GifEncoder =…
divinelemon
  • 1,925
  • 2
  • 23
1
vote
1 answer

NodeJS peaking at 6Gb when manipulating images with Jimp

I need to edit 34 000 photos on a pixel scale, so I wrote a program that replaces pixels in an image if they are over a specific RBG value (240, 240, 240), basically I want to isolate only white pixels and set everything else to black. This is my…
Kub_Luk
  • 60
  • 5
1
vote
0 answers

how can I prevent an unwanted file rotation?

I am using a jimp library to adjust contrast to image and to resize it. for some jpeg files, the original file changed to landscape without any intention. why does it do it and how can I prevent this unwanted file rotation? async function…
1
vote
0 answers

JIMP image composite not rendered

I'm using Jimp with nodejs to create a dynamic image of a date, This is my function: const buildDate = function(date) { return new Promise(function(resolve, reject) { Jimp.create(55, 500).then(dateCanvas => { for (let i = 0;…
1
vote
0 answers

Issue with uploading Original image and watermarked image to aws s3 bucket

I'm working on functionality for my project to upload an inputted image to aws, watermark it using jimp, and then upload the watermarked image to aws. All of the functionality works, however, only the pre-watermarked image is getting uploaded twice…
1
vote
1 answer

Error: Could not find MIME for Buffer while using Jimp to save the buffer of cv.Mat()

Here is the snippet of my code which produce the error: let mat = cv.Mat.zeros(cnn_size, cnn_size, 3); savepath = "path/to/saved/image.jpg" let bf = Buffer.from(mat.data); Jimp.read(bf).then(data => { console.log(data); return…
Tung
  • 112
  • 2
  • 13
1
vote
4 answers

JavaScript image processing in React Native using Jimp

I was trying to make an app that gets the color of an image captured by the camera with react native with expo. I used Jimp, a JavaScript image-processing library but it's showing this error. Look at this code. import { StatusBar } from…
1
vote
1 answer

How to remove alpha channel in image using Jimp js?

I tried to use the code below or .rgba(false) which corrupted the file. Jimp.read(img).then((image) => { image.background(0x00000000); })
Roma
  • 449
  • 6
  • 23
1
vote
1 answer

Jimp - URIs are returned from the function but the images are not rendered in the 's src

I am coding in Svelte and use jimp to blur the image before displaying. However, I successfully blur and return the images' URIs (logged and had the URIs displayed in the console), but the images are not render where i call the function in the
jasonph
  • 134
  • 5
1
vote
0 answers

Jimp. No matching constructor overloading was found. Please see the docs for how to call the Jimp constructor

I am getting this error when trying to create a Jimp object from a buffer. The weird thing is, this works consistently when the screenshot is of the full thing but doesn't work at some croppings of the screenshot ie. when I am inputting a…
BradleyB19
  • 147
  • 5
  • 10
1
vote
1 answer

function is timing out when http-triggered

What am I doing wrong? Why is the function timing out? I have a blob triggered function which works totally fine: const Jimp = require("jimp"); module.exports = function(context, myBlob) { const correlation =…
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062